|
|
|
|
@ -6,7 +6,7 @@
|
|
|
|
|
# username := the default username to use for the ssh connection
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
|
# Updating ssh config for servers with given stage
|
|
|
|
|
# Creating inventory dynamically for given parameters
|
|
|
|
|
#############################################################
|
|
|
|
|
|
|
|
|
|
- hosts: localhost
|
|
|
|
|
@ -21,6 +21,24 @@
|
|
|
|
|
- ansible_version.minor >= 10
|
|
|
|
|
msg: "The ansible version has to be at least ({{ ansible_version.full }})"
|
|
|
|
|
|
|
|
|
|
# add fictive server to load stage specific variables
|
|
|
|
|
- name: "Add <{{ stage }}-virtual-smardigo-host> to hosts"
|
|
|
|
|
add_host:
|
|
|
|
|
name: "{{ stage }}-virtual-smardigo-host"
|
|
|
|
|
groups:
|
|
|
|
|
- "stage_{{ stage }}"
|
|
|
|
|
changed_when: False
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
|
# Updating ssh config for servers with given stage
|
|
|
|
|
#############################################################
|
|
|
|
|
|
|
|
|
|
- hosts: "{{ stage }}-virtual-smardigo-host"
|
|
|
|
|
serial: "{{ serial_number | default(1) }}"
|
|
|
|
|
gather_facts: false
|
|
|
|
|
connection: local
|
|
|
|
|
|
|
|
|
|
pre_tasks:
|
|
|
|
|
- name: "Reading current server groups from hetzner"
|
|
|
|
|
include_role:
|
|
|
|
|
name: hcloud
|
|
|
|
|
@ -46,4 +64,4 @@
|
|
|
|
|
Host {{ host.name }}
|
|
|
|
|
HostName {{ host.ip }}
|
|
|
|
|
User {{ username }}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|