Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yienge/db76374f438ba9b3a6a567d14d0a9b23 to your computer and use it in GitHub Desktop.
Save yienge/db76374f438ba9b3a6a567d14d0a9b23 to your computer and use it in GitHub Desktop.
Ansible Linode template (tested and working)
#### CentOS: yum install pip ; pip install linode-python ; pip install chube
####
- hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Create linode server
linode:
api_key: '---LINODE-API-KEY-HERE---'
name: linodeserver
plan: 1 #cheapest
datacenter: 6 #newmark NJ
distribution: 127 #centos 6.5
password: '-AUX-PASSWORD-HERE'
ssh_pub_key: 'ssh-rsa AAAAB3NzaC----RSA HERE-----'
wait: yes
wait_timeout: 300
state: present
register: linode
- name: Adding the new box to the dynamic inventory
add_host: hostname="{{ linode.instance.ipv4 }}" groupname=linodehosts
- name: Wait for SSH to come up
local_action: wait_for host="{{ linode.instance.ipv4 }}" port=22 delay=60 timeout=320 state=started
- name: Cooking the instance....
hosts: linodehosts
user: root
gather_facts: true
roles:
- base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment