cloud-init.tpl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #cloud-config
  2. preserve_hostname: false
  3. hostname: ${hostname}
  4. salt-master: ${saltmaster}
  5. fqdn: ${fqdn}
  6. # A lot of this could be done via salt. But for simplicity, i'm presently keeping it out.
  7. yum_repos:
  8. epel-release:
  9. baseurl: http://download.fedoraproject.org/pub/epel/7/$basearch
  10. enabled: true
  11. failovermethod: priority
  12. gpgcheck: true
  13. gpgkey: http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
  14. name: Extra Packages for Enterprise Linux 7 - Release
  15. packages:
  16. - vim
  17. package_update: true # Always patch
  18. growpart:
  19. mode: auto
  20. devices: [ '/', '/var', '/var/log', '/var/log/audit', '/var/tmp', '/tmp', '/home' ]
  21. ignore_growroot_disabled: false
  22. runcmd:
  23. - 'echo ${fqdn} > /etc/salt/minion_id'
  24. - 'echo master: ${saltmaster} > /etc/salt/minion'
  25. - 'echo grains: > /etc/salt/minion.d/cloud_init_grains.conf'
  26. - 'echo " environment: " ${ environment } >> /etc/salt/minion.d/cloud_init_grains.conf'
  27. - 'echo " aws_partition: " ${ aws_partition } >> /etc/salt/minion.d/cloud_init_grains.conf'
  28. - 'echo " aws_partition_alias: " ${ aws_partition_alias } >> /etc/salt/minion.d/cloud_init_grains.conf'
  29. - 'echo " interconnect_id: " ${ interconnect_id } >> /etc/salt/minion.d/cloud_init_grains.conf'
  30. - 'echo " vpc_cidr: " ${ vpc_cidr } >> /etc/salt/minion.d/cloud_init_grains.conf'
  31. - /bin/systemctl restart salt-minion
  32. - /bin/systemctl enable salt-minion
  33. - /bin/systemctl start amazon-ssm-agent
  34. - /bin/systemctl enable amazon-ssm-agent
  35. - /usr/sbin/aide --update --verbose=0
  36. - /bin/cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
  37. # Either final message or power state, but probably not both
  38. final_message: "The system is up after $UPTIME seconds"
  39. #power_state:
  40. # delay: "+30"
  41. # mode: reboot
  42. # message: "System configured after $UPTIME seconds"
  43. # timeout: 300
  44. # condition: true