Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible_cluster_in_a_box
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chris Hines
ansible_cluster_in_a_box
Commits
2de17d14
Commit
2de17d14
authored
9 years ago
by
Simon Michnowicz
Browse files
Options
Downloads
Patches
Plain Diff
added conditionals to prevent installation if drivers already present (Note, tested only on redhat)
parent
17b43371
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/mellanox_drivers/tasks/main.yml
+18
-15
18 additions, 15 deletions
roles/mellanox_drivers/tasks/main.yml
with
18 additions
and
15 deletions
roles/mellanox_drivers/tasks/main.yml
+
18
−
15
View file @
2de17d14
...
...
@@ -8,11 +8,17 @@
ignore_errors
:
true
when
:
ansible_os_family == "RedHat"
-
name
:
test for existing installation of drivers
command
:
ibv_devinfo
sudo
:
true
register
:
drivers_installed
ignore_errors
:
true
-
name
:
yum update to upgrade kernel
shell
:
"
yum
update
-y"
sudo
:
true
ignore_errors
:
true
when
:
ansible_os_family == "RedHat"
when
:
ansible_os_family == "RedHat"
and drivers_installed|failed
#
# A REBOOT IS NEEDED AFTER a KERNEL UPDATE
...
...
@@ -23,10 +29,9 @@
poll
:
0
ignore_errors
:
true
sudo
:
true
when
:
ansible_os_family == "RedHat"
when
:
ansible_os_family == "RedHat"
and drivers_installed|failed
-
name
:
waiting for server to come back
#local_action: wait_for host={{ ansible_host }} state=started port=22 delay=10 search_regex=OpenSSH
local_action
:
wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo
:
false
...
...
@@ -34,11 +39,6 @@
local_action
:
wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo
:
false
-
name
:
test for existing installation of drivers
command
:
ibv_devinfo
sudo
:
true
register
:
drivers_installed
ignore_errors
:
true
-
name
:
copy driver source
#make this a variable
...
...
@@ -62,12 +62,14 @@
local_action
:
command ./scripts/map_ib_ip.pl {{ inventory_hostname }}
register
:
ip_address
sudo
:
false
#when: drivers_installed|failed
-
name
:
template IP address
template
:
dest=/etc/sysconfig/network-scripts/ifcfg-ens6 src=ifcfg-ens6.j2 owner=root group=root
sudo
:
true
when
:
ansible_os_family=="RedHat" and ansible_distribution_major_version == "7"
when
:
ansible_os_family=="RedHat" and ansible_distribution_major_version == "7" and drivers_installed|failed
#ubuntu equivalent of previous command
-
name
:
Ubuntu network interfaces - line
1
lineinfile
:
...
...
@@ -76,7 +78,8 @@
line
:
auto {{ MELLANOX_DEVICE_NAME }}
state
:
present
sudo
:
true
when
:
ansible_os_family=="Debian"
when
:
ansible_os_family=="Debian" and drivers_installed|failed
-
name
:
Ubuntu network interfaces - line
2
lineinfile
:
args
:
...
...
@@ -85,7 +88,7 @@
state
:
present
insertafter
:
"
auto
{{
MELLANOX_DEVICE_NAME
}}"
sudo
:
true
when
:
ansible_os_family=="Debian"
when
:
ansible_os_family=="Debian"
and drivers_installed|failed
-
name
:
Ubuntu network interfaces - line
3
lineinfile
:
args
:
...
...
@@ -94,7 +97,7 @@
state
:
present
insertafter
:
"
iface
{{
MELLANOX_DEVICE_NAME
}}
inet
static"
sudo
:
true
when
:
ansible_os_family=="Debian"
when
:
ansible_os_family=="Debian"
and drivers_installed|failed
#
# A REBOOT IS NEEDED AFTER SUCCESSFUL INSTALL
#
...
...
@@ -104,12 +107,12 @@
poll
:
0
ignore_errors
:
true
sudo
:
true
when
:
ansible_os_family=="Centos"
when
:
ansible_os_family=="Centos"
and drivers_installed|failed
-
name
:
restart machine for Ubuntu -cos it is 'special'
command
:
"
sudo
shutdown
-r
now"
shell
:
"
sleep
5;
sudo
shutdown
-r
now"
async
:
2
poll
:
0
poll
:
1
ignore_errors
:
true
sudo
:
true
when
:
ansible_os_family=="Debian"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment