user-data 615 B

1234567891011121314151617181920212223
  1. #cloud-config
  2. disable_root: true
  3. hostname: {{ item[0] }}
  4. fqdn: {{ item[0] }}.example.com
  5. manage_etc_hosts: true
  6. users:
  7. - default
  8. - name: root
  9. ssh_authorized_keys:
  10. - {{ lookup('file', '~/.ssh/id_rsa.pub') }}
  11. system_info:
  12. default_user:
  13. name: openshift
  14. sudo: ["ALL=(ALL) NOPASSWD: ALL"]
  15. ssh_authorized_keys:
  16. - {{ lookup('file', '~/.ssh/id_rsa.pub') }}
  17. bootcmd:
  18. - 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