Last active
August 7, 2017 13:21
-
-
Save vicendominguez/805fb9f5426083a7ab05 to your computer and use it in GitHub Desktop.
Ansible Linode template (tested and working)
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
#### 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