cloud-init.tpl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #cloud-config
  2. preserve_hostname: false
  3. salt-master: ${salt_master}
  4. # Write files happens early
  5. write_files:
  6. - content: |
  7. proxy=http://${proxy}:80
  8. path: /etc/yum.conf
  9. append: true
  10. - content: |
  11. master: ${salt_master}
  12. path: /etc/salt/minion
  13. - content: |
  14. grains:
  15. environment: ${ environment }
  16. aws_partition: ${ aws_partition }
  17. aws_partition_alias: ${ aws_partition_alias }
  18. path: /etc/salt/minion.d/cloud_init_grains.conf
  19. #yum_repos:
  20. # epel-release:
  21. # baseurl: http://download.fedoraproject.org/pub/epel/7/$basearch
  22. # enabled: false
  23. # failovermethod: priority
  24. # gpgcheck: true
  25. # gpgkey: http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
  26. # name: Extra Packages for Enterprise Linux 7 - Release
  27. packages:
  28. - vim
  29. package_update: true # Always patch
  30. growpart:
  31. mode: auto
  32. devices: [ '/', '/var', '/var/log', '/var/log/audit', '/var/tmp', '/tmp', '/home' ]
  33. ignore_growroot_disabled: false
  34. bootcmd:
  35. - "INSTANCE_ID=`/usr/bin/curl -f --connect-timeout 1 --silent http://169.254.169.254/latest/meta-data/instance-id`"
  36. - "/bin/hostnamectl set-hostname ${prefix}-splunk-indexer-$INSTANCE_ID'.${zone}'"
  37. - "/bin/hostname > /etc/salt/minion_id"
  38. runcmd:
  39. - /bin/systemctl restart salt-minion
  40. - /bin/systemctl enable salt-minion
  41. - /bin/systemctl start amazon-ssm-agent
  42. - /bin/systemctl enable amazon-ssm-agent
  43. - /usr/sbin/aide --update --verbose=0
  44. - /bin/cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
  45. # For indexers only
  46. # legacy slept for 20 seconds, but I think aide update will take care of that delay
  47. - /bin/salt-call saltutil.sync_all
  48. - /bin/salt-call saltutil.refresh_pillar
  49. - /bin/salt-call saltutil.refresh_grains
  50. - /bin/salt-call state.highstate
  51. # Either final message or power state, but probably not both
  52. final_message: "The system is up after $UPTIME seconds"
  53. #power_state:
  54. # delay: "+30"
  55. # mode: reboot
  56. # message: "System configured after $UPTIME seconds"
  57. # timeout: 300
  58. # condition: true