Skip to content
Snippets Groups Projects
Commit fe244ad2 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#85 Linting

parent ae4afc57
No related branches found
No related tags found
No related merge requests found
---
# file: cleanup.yml
- name: "Remove host from known_hosts"
- name: Remove host from known_hosts
known_hosts:
name="{{ item }}"
state="absent"
with_items:
- '{{ static_ipv4|default(false) }}'
- '{{ host }}'
- {{ static_ipv4|default(false) }}
- {{ host }}
- name: "Remove host from hosts file 1"
- name: Remove host from hosts file 1
lineinfile:
dest=/etc/hosts
regexp='{{ item }}'
state=absent
become: yes
with_items:
- '^{{ static_ipv4|default(false) }} '
- ^{{ static_ipv4|default(false) }}
- name: "Remove host from hosts file 2"
- name: Remove host from hosts file 2
lineinfile:
dest=/etc/hosts
regexp='{{ item }}'
state=absent
become: yes
with_items:
- '.* {{ host }}$'
- .* {{ host }}$
......@@ -4,9 +4,9 @@
---
# file: ec2/inithost.yml
- name: "Create the new instance"
- name: Create the new instance
ec2:
instance_tags: '{"Name":"Ansible-Host-{{ host }}","AnsibleHost":"{{ host }}","AnsibleGroups":"{{ initgroups }}"}'
instance_tags: {"Name":"Ansible-Host-{{ host }}","AnsibleHost":"{{ host }}","AnsibleGroups":"{{ initgroups }}"}
assign_public_ip: yes
group_id: "{{ ec2_group_id }}"
key_name: "{{ ec2_key_name }}"
......@@ -18,7 +18,7 @@
wait: yes
register: ec2
- name: "Waiting for the new instance(s) to get up and running"
- name: Waiting for the new instance(s) to get up and running
ec2:
instance_ids: "{{ ec2.instance_ids }}"
instance_type: "{{ ec2_instance_type }}"
......@@ -28,7 +28,7 @@
- block:
- name: "Associate an elastic IP with the new instance"
- name: Associate an elastic IP with the new instance
ec2_eip:
device_id: "{{ item }}"
public_ip: '{{ inithostip }}'
......
---
# file: ec2/inithostip.yml
- name: "Add new instance(s) to the inventory"
- name: Add new instance(s) to the inventory
add_host:
hostname="{{ host }}"
static_ipv4="{{ hostip }}"
groups="{{ initgroups }}"
- name: "Waiting for SSH service becoming available"
- name: Waiting for SSH service becoming available
wait_for:
host="{{ hostip }}"
port=22
......
......@@ -4,7 +4,7 @@
---
# file: ec2/removehost.yml
- name: "Terminate the instance"
- name: Terminate the instance
ec2:
instance_ids: "{{ ec2_id }}"
instance_type: "{{ ec2_instance_type }}"
......
......@@ -4,5 +4,5 @@
---
# file: jiffybox/inithost.yml
- name: "No cloud action required"
- name: No cloud action required
debug: msg="IGNORE inithost"
......@@ -4,5 +4,5 @@
---
# file: jiffybox/inithostip.yml
- name: "No cloud action required"
- name: No cloud action required
debug: msg="IGNORE inithostip"
......@@ -4,5 +4,5 @@
---
# file: jiffybox/removehost.yml
- name: "No cloud action required"
- name: No cloud action required
debug: msg="IGNORE removehost"
......@@ -4,5 +4,5 @@
---
# file: linode/inithost.yml
- name: "No cloud action required"
- name: No cloud action required
debug: msg="IGNORE inithost"
......@@ -4,5 +4,5 @@
---
# file: linode/inithostip.yml
- name: "No cloud action required"
- name: No cloud action required
debug: msg="IGNORE inithostip"
......@@ -4,5 +4,5 @@
---
# file: linode/removehost.yml
- name: "No cloud action required"
- name: No cloud action required
debug: msg="IGNORE removehost"
---
# file: roles/cloud/tasks/main.yml
- name: "Cloud Role"
set_fact: role_cloud_started=true
tags: 'always'
- name: Cloud Role
set_fact:
role_cloud_started: yes
tags:
- always
- block:
......@@ -11,4 +13,4 @@
- import_tasks: "{{ mode }}.yml"
when: '"cloud" not in excluded_roles'
when: not excluded_roles or "cloud" not in excluded_roles
......@@ -4,5 +4,5 @@
---
# file: none/inithost.yml
- name: "No cloud action required"
- name: No cloud action required
debug: msg="IGNORE inithost"
......@@ -4,5 +4,5 @@
---
# file: none/inithostip.yml
- name: "No cloud action required"
- name: No cloud action required
debug: msg="IGNORE inithostip"
......@@ -4,5 +4,5 @@
---
# file: none/removehost.yml
- name: "No cloud action required"
- name: No cloud action required
debug: msg="IGNORE removehost"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment