cloud-init.tpl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #cloud-config
  2. preserve_hostname: false
  3. hostname: ${hostname}
  4. salt-master: ${saltmaster}
  5. fqdn: ${fqdn}
  6. # NOTE: See the cloud-init.tpl under dns/resolver_instance for an
  7. # example of how to do this on a system that needs the proxy.
  8. yum_repos:
  9. epel-release:
  10. baseurl: http://download.fedoraproject.org/pub/epel/7/$basearch
  11. enabled: false
  12. failovermethod: priority
  13. gpgcheck: true
  14. gpgkey: http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
  15. name: Extra Packages for Enterprise Linux 7 - Release
  16. packages:
  17. - vim
  18. package_update: true # Always patch
  19. growpart:
  20. mode: auto
  21. devices: [ '/', '/var', '/var/log', '/var/log/audit', '/var/tmp', '/tmp', '/home' ]
  22. ignore_growroot_disabled: false
  23. runcmd:
  24. - 'mkdir -p /etc/salt/minion.d'
  25. - 'echo ${fqdn} > /etc/salt/minion_id'
  26. - 'echo master: ${saltmaster} > /etc/salt/minion'
  27. - 'echo grains: > /etc/salt/minion.d/cloud_init_grains.conf'
  28. - 'echo " environment: " ${ environment } >> /etc/salt/minion.d/cloud_init_grains.conf'
  29. - 'echo " aws_partition: " ${ aws_partition } >> /etc/salt/minion.d/cloud_init_grains.conf'
  30. - 'echo " aws_partition_alias: " ${ aws_partition_alias } >> /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