De Wiki inetshell
Saltar a: navegación, buscar

Ejemplos de uso[editar]

https://cloudinit.readthedocs.io/en/latest/topics/examples.html

Desactivar Cloud-Init[editar]

https://stackoverflow.com/questions/37809728/uninstall-remove-or-disable-cloud-init-on-centos

sudo touch /etc/cloud/cloud-init.disabled

Definir IP estatica[editar]

https://gist.github.com/tomfanning/562c14993cc4aabe354f535f18bd143d

#meta-data:
instance-id: hostname
network-interfaces: |
  auto eth0
  iface eth0 inet static
  address 192.168.1.34
  network 192.168.1.0
  netmask 255.255.255.0
  broadcast 192.168.1.255
  gateway 192.168.1.254
local-hostname: hostname




#user-data:
#cloud-config
ssh_pwauth: True
users:
  - name: root
chpasswd:
  list: |
    root:[email protected]
  expire: False
runcmd:
  - echo "runcmd started"
  - ifdown eth0
  - echo "DNS1=8.8.8.8" >> /etc/sysconfig/network-scripts/ifcfg-eth0
  - echo "DNS2=8.8.4.4" >> /etc/sysconfig/network-scripts/ifcfg-eth0
  - ifup eth0
  - echo "runcmd ended"


#script to generate ISO:
genisoimage -output cd.iso -volid cidata -joliet -rock contents

Definir DNS[editar]

https://superuser.com/questions/110808/how-can-i-add-additional-search-domains-to-the-resolv-conf-created-by-dhclient-i