Facebook
From Scribby Crow, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 73
  1. #cloud-config
  2.  
  3. write_files:
  4. - path: '/opt/bin/firstrun.sh'
  5.   content: |-
  6.     #!/bin/bash
  7.     yum install -y curl jq
  8.  
  9.     echo "#cloud-config\nssh_pwauth: false" > /etc/cloud/cloud.cfg.d/my-custom.cfg
  10.  
  11.     cloud-init clean
  12.     cloud-init --file /etc/cloud/cloud.cfg.d/my-custom.cfg init
  13.  
  14. - path: '/etc/systemd/system/firstrun.service'
  15.   content: |-
  16.     [Service]
  17.     Type=oneshot
  18.     RemainAfterExit=true
  19.     ExecStart=/opt/bin/firstrun
  20.  
  21.  
  22. runcmd:
  23. - systemctl start firstrun.service
  24.