user-data 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #cloud-config
  2. disable_root: true
  3. hostname: {{ item[0] }}
  4. fqdn: {{ item[0] }}.example.com
  5. mounts:
  6. - [ sdb ]
  7. users:
  8. - default
  9. - name: root
  10. ssh_authorized_keys:
  11. - {{ lookup('file', '~/.ssh/id_rsa.pub') }}
  12. system_info:
  13. default_user:
  14. name: openshift
  15. sudo: ["ALL=(ALL) NOPASSWD: ALL"]
  16. ssh_authorized_keys:
  17. - {{ lookup('file', '~/.ssh/id_rsa.pub') }}
  18. write_files:
  19. - path: /etc/sudoers.d/00-openshift-no-requiretty
  20. permissions: 440
  21. content: |
  22. Defaults:openshift !requiretty
  23. - path: /etc/sysconfig/docker-storage-setup
  24. owner: root:root
  25. permissions: '0644'
  26. content: |
  27. DEVS=/dev/sdb
  28. VG=docker_vg
  29. EXTRA_DOCKER_STORAGE_OPTIONS='--storage-opt dm.blkdiscard=true'
  30. - path: /etc/systemd/system/fstrim.timer.d/hourly.conf
  31. content: |
  32. [Timer]
  33. OnCalendar=hourly
  34. runcmd:
  35. - 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
  36. - systemctl enable --now fstrim.timer