User Tools

Site Tools


linux:cloud-init:from_scratch

Cloud-init basic knowledge

Documentation
Name: Cloud-init basic knowledge
Description: Cloud-init basic knowledge
Modification date :23/05/2018
Owner:dodger@ciberterminal.net
Notify changes to:backOps tuxe's
Tags:

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:10.51.4.138:~$ 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:

runcmd:
  - [ curl, -k, -o, /etc/tmux.conf, "https://dokuwiki.ciberterminal.net/doku.php?do=export_code&id=tools:tmux&codeblock=0" ]
  - [ curl, -k, -o, /etc/bashrc, "https://dokuwiki.ciberterminal.net/doku.php?do=export_code&id=tools:bashrc&codeblock=0" ]
  - [ curl, -k, -o, /etc/vimrc, "https://dokuwiki.ciberterminal.net/doku.php?do=export_code&id=tools:vim&codeblock=0" ]

YAML validation

Examples

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