Browse Source

Use runcmd to restart network.

Using bootcmd in cloud-config lead to restarts prior to starting the
systemd-hostnamed, which was probable cause of the failure when DHCP
client was failing to send the hostname, and subsequently, the
ansible-opnshift was not able to identify the VM among the others when
checking DHCP leases. The failure looked like: following

10:17:31 failed: [localhost] => {"attempts": 60, "changed": true, "cmd": "virsh -c qemu:///system net-dhcp-leases openshift-ansible | egrep -c 'experiment-node-compute-453d0|experiment-node-compute-61e16'", "delta": "0:00:00.033061", "end": "2015-10-19 10:17:31.409434", "failed": true, "rc": 0, "start": "2015-10-19 10:17:31.376373", "warnings": []}
10:17:31 stdout: 1
10:17:31 msg: Task failed as maximum retries was encountered
Jaroslav Henner 9 years ago
parent
commit
14598f3a9c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      playbooks/libvirt/openshift-cluster/templates/user-data

+ 1 - 1
playbooks/libvirt/openshift-cluster/templates/user-data

@@ -19,5 +19,5 @@ system_info:
 ssh_authorized_keys:
   - {{ lookup('file', '~/.ssh/id_rsa.pub') }}
 
-bootcmd:
+runcmd:
   - NETWORK_CONFIG=/etc/sysconfig/network-scripts/ifcfg-eth0; if ! grep DHCP_HOSTNAME ${NETWORK_CONFIG}; then echo 'DHCP_HOSTNAME="{{ item[0] }}.example.com"' >> ${NETWORK_CONFIG}; fi; pkill -9 dhclient; service network restart