User Tools

Site Tools


Cloud-init basic knowledge

Name: Cloud-init basic knowledge
Description: Cloud-init basic knowledge
Modification date :23/05/2018
Notify changes to:backOps tuxe's

Basic Knowledge

All my tests indicate that the script run in this order:

  • Initial config:
    • fqdn
    • hostname
  • upgrade
  • packages
  • runcmd
  • users

Ignored orders:

  • resolv_conf

Template creation

Install cloud-init in the template:

yum install cloud-init

Create the image for image service:

nutanix@NTNX-67YVTB2-A-CVM:$ acli image.create TMPL-CentOS7-cloud clone_from_vmdisk=vm:TMPL-CentOS7.1804:scsi.0 image_type=kDiskImage
TMPL-CentOS7-cloud: pending
TMPL-CentOS7-cloud: complete

Sample scripts

Very simple script

Latest YAML script version will be on:
Standard cloud-init script

Additional lines that can be added

Disable selinux

  - [ sed, -i, "s/SELINUX=enforcing/SELINUX=disabled/g", /etc/sysconfig/selinux ]
  - [ sed, -i, "s/SELINUX=permissive/SELINUX=disabled/g", /etc/sysconfig/selinux ]

bofher configs

That files can be added as salt states:

  - [ curl, -k, -o, /etc/tmux.conf, "" ]
  - [ curl, -k, -o, /etc/bashrc, "" ]
  - [ curl, -k, -o, /etc/vimrc, "" ]

YAML validation


linux/cloud-init/from_scratch.txt · Last modified: 2022/02/11 11:36 by