-
Notifications
You must be signed in to change notification settings - Fork 15
Added IPv4 and other related playbooks #34
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Standards: 1.7 | ||
| --- | ||
| - hosts: servers | ||
| tasks: | ||
| - name: Install vim, screen and wget | ||
| yum: | ||
| name: "{{ item }}" | ||
| state: latest | ||
| with_items: | ||
| - vim | ||
| - screen | ||
| - wget | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| - hosts: all | ||
| tasks: | ||
| - name: Setup IP over IB | ||
| debug: | ||
| msg: "This is my IP {{ MY_IP }}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| - hosts: servers | ||
| tasks: | ||
| - name: Configures the first 10G nic with an active link | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment talks about plumbing this into the playbook:
The above would complete the required plumbing to run this play as part of the playbook, when a setup deals with only IPv4 addresses, and needs one setup for it. |
||
| shell: | | ||
| for dev in $(ls /sys/class/net/) | ||
| do | ||
| link=$(ethtool ${dev} | grep "Link detected: yes" &> /dev/null; echo $?) | ||
| if [ $link -eq 0 ] | ||
| then | ||
| speed=$(ethtool ${dev} | grep "Speed: 10000Mb/s" &> /dev/null; echo $?) | ||
| if [ $speed -eq 0 ] | ||
| then | ||
| export MY_NIC=${dev} | ||
| break | ||
| fi | ||
| fi | ||
| done | ||
| echo "DEVICE=${MY_NIC}" > /etc/sysconfig/network-scripts/ifcfg-${MY_NIC} | ||
| echo "BOOTPROTO=none" >> /etc/sysconfig/network-scripts/ifcfg-${MY_NIC} | ||
| echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-${MY_NIC} | ||
| echo "TYPE=Ethernet" >> /etc/sysconfig/network-scripts/ifcfg-${MY_NIC} | ||
| echo "PREFIX=24" >> /etc/sysconfig/network-scripts/ifcfg-${MY_NIC} | ||
| echo "IPADDR=${MY_IP}" >> /etc/sysconfig/network-scripts/ifcfg-${MY_NIC} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MY_IP here would be replaced with the variable confipv4addr when defined in the setup-profile, like, |
||
|
|
||
| - name: Restarts NW | ||
| service: | ||
| name: network | ||
| state: restarted | ||
|
|
||
| - name: Ping test new IP | ||
| shell: | | ||
| vgremove -f `vgs --noheadings -o vg_name | egrep -v "vg_rhsauto|vg_storageqe|TestVolume001" | tr '\n' ' '` | ||
| pvremove -ff -y `pvs --noheadings -o pv_name | egrep -v "vda|sda" | tr '\n' ' '` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assume above 2 lines will be removed, as they are not a part of this play. |
||
| ping -c 1 ${MY_IP} | ||
| if [ $? -eq 0 ] | ||
| then | ||
| exit 0 | ||
| else | ||
| exit 1 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not clear what this play does. I assume each server should have its hosts file updated with the others. I would suggest we use ansible templates and copy them over to the servers, than running a script. Also if you can let me know what the variables are, and where they come from, we can talk about how to plumb them as well through ansible variables. |
||
| - hosts: servers | ||
| tasks: | ||
| - name: Configures the first 10G nic with an active link | ||
| shell: | | ||
| echo "" >> /etc/hosts | ||
| x=1 | ||
| for node in $MASTERNODE $NODE | ||
| do | ||
| echo "$(echo $IP_LIST | cut -d " " -f ${x}) $(echo ${node} | cut -d "." -f 1)-priv.css.lab.eng.rdu2.redhat.com $(echo ${node} | cut -d "." -f 1)-priv" >> /etc/hosts | ||
| x=$((x+1)) | ||
| done | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are independent plays, not a role yet, can you change that!