Last active
September 14, 2015 09:52
-
-
Save kgrvamsi/c4c1c801a431c9d02ed7 to your computer and use it in GitHub Desktop.
Cloud init Theory and Tutorials
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cloud Init is one of the automated configuration tool that does the automation of services at the boot up | |
############## | |
# Reference URLS | |
############### | |
http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt | |
http://cloudinit.readthedocs.org/en/latest/topics/examples.html | |
############### | |
Cloud init DSL | |
############### | |
apt_update: true | |
apt_upgrade: true | |
packages: | |
- apache2 | |
- rsync | |
### this import the key from the launchpad username | |
ssh_import_id: [user1, user2] | |
### this will add each entry to the authorized keys list | |
ssh_authorized_keys: | |
- ssh-rsa keydescription | |
### this will enable the byobu terminal | |
byobu_by_default: system | user | |
#### This will runcmd | |
runcmd: | |
- [ wget, "www.google.com", -O, /tmp/index.html ] | |
####### Setting the Hostname | |
hostname: testing | |
fqdn: testing.example.com | |
manage_etc_hosts: true | |
### Adding users | |
users: | |
- name: test | |
groups: test | |
shell: /bin/bash | |
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | |
### Addign groups | |
groups: | |
- group1 | |
- group2: [user1, user2] | |
###changing the password | |
chpasswd: | |
list: | | |
user1:password1 | |
expire: False | |
### Writing files to a specified location | |
write_files: | |
- path: /test.txt | |
content: | | |
Hello World. | |
### Upgrading all the packages | |
package_upgrade: true | |
#### Managing the resolve.conf file | |
manage-resolv-conf: true | |
resolv_conf: | |
nameservers: | |
- '8.8.8.8' | |
#### rebooting the machine | |
power_state: | |
timeout: 120 | |
delay: "+5" | |
message: Rebooting in five minutes | |
mode: reboot | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment