From d47edf672c781ffc5ffbc1800ff9465cdd0e788e Mon Sep 17 00:00:00 2001 From: Sven Ketelsen Date: Thu, 3 Feb 2022 19:52:35 +0100 Subject: [PATCH] chore: consolidation --- create-database-backup.yml | 12 +++++----- create-database.yml | 12 +++++----- create-kibana-objects.yml | 12 +++++----- create-realm.yml | 12 +++++----- create-server.yml | 14 ++++++------ create-service.yml | 12 +++++----- hcloud_firewall.yml | 44 ++++++++++++++++++++++++++++++++++--- import-database.yml | 12 +++++----- remove-database.yml | 12 +++++----- remove-realm.yml | 12 +++++----- remove-server.yml | 10 ++++----- remove-service.yml | 10 ++++----- restore-database-backup.yml | 12 +++++----- stage-prodnso | 11 ++-------- update-monitoring.yml | 2 +- update-service-state.yml | 12 +++++----- update-ssh-config-file.yml | 10 ++++----- upload-database-dumb.yml | 2 +- 18 files changed, 127 insertions(+), 96 deletions(-) diff --git a/create-database-backup.yml b/create-database-backup.yml index ccb8cca..ca412a8 100644 --- a/create-database-backup.yml +++ b/create-database-backup.yml @@ -7,7 +7,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -35,10 +35,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -58,7 +58,7 @@ # Creating database backups for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -88,7 +88,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-database.yml b/create-database.yml index 0da8c07..735ed89 100644 --- a/create-database.yml +++ b/create-database.yml @@ -14,7 +14,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -41,10 +41,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -74,7 +74,7 @@ # Creating databases for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -120,7 +120,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-kibana-objects.yml b/create-kibana-objects.yml index 013e44c..af4f6fc 100644 --- a/create-kibana-objects.yml +++ b/create-kibana-objects.yml @@ -7,7 +7,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -34,10 +34,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -54,7 +54,7 @@ # Creating kibana search objects for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: no remote_user: root @@ -191,7 +191,7 @@ ############################################################# # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-realm.yml b/create-realm.yml index f752f03..51fe8da 100644 --- a/create-realm.yml +++ b/create-realm.yml @@ -5,7 +5,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -35,10 +35,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -55,7 +55,7 @@ # Creating realms for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false @@ -81,7 +81,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-server.yml b/create-server.yml index 0b811a2..a6951e7 100644 --- a/create-server.yml +++ b/create-server.yml @@ -2,7 +2,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -28,10 +28,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -50,7 +50,7 @@ # Creating servers for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(5) }}" gather_facts: false @@ -94,7 +94,7 @@ # Provisioning servers for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -140,7 +140,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/create-service.yml b/create-service.yml index 0b4acf2..92717c7 100644 --- a/create-service.yml +++ b/create-service.yml @@ -2,7 +2,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -29,10 +29,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -49,7 +49,7 @@ # Creating services for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -70,7 +70,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/hcloud_firewall.yml b/hcloud_firewall.yml index 8beb4e5..0b8fd14 100644 --- a/hcloud_firewall.yml +++ b/hcloud_firewall.yml @@ -1,11 +1,49 @@ --- -- hosts: hcloud_fw + +# updates firewall config + +# Parameters: +# playbook inventory +# stage := the name of the stage (e.g. dev, int, qa, prod) + +############################################################# +# Creating inventory dynamically for given parameters +############################################################# + +- hosts: localhost + gather_facts: false connection: local + + pre_tasks: + - name: "Check if ansible version is at least 2.10.x" + assert: + that: + - ansible_version.major >= 2 + - ansible_version.minor >= 10 + msg: "The ansible version has to be at least ({{ ansible_version.full }})" + +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" + add_host: + name: "{{ stage }}-virtual-host-to-read-groups-vars" + groups: + - "stage_{{ stage }}" + changed_when: False + +############################################################# +# Creating inventory dynamically for given parameters +############################################################# + +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" + serial: "{{ serial_number | default(1) }}" + gather_facts: false + connection: local + tasks: - - name: "Setup hcloud firewall via include_role" + - name: "Setup hcloud firewall via include_role" include_role: name: hcloud - tasks_from: configure-firewall2 + tasks_from: configure-firewall2 loop: "{{ hcloud_firewall_objects }}" loop_control: loop_var: firewall_object diff --git a/import-database.yml b/import-database.yml index 297e7a9..2f20933 100644 --- a/import-database.yml +++ b/import-database.yml @@ -2,7 +2,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -31,10 +31,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -54,7 +54,7 @@ # Importing database backups for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -82,7 +82,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/remove-database.yml b/remove-database.yml index dbbf616..1bdd92c 100644 --- a/remove-database.yml +++ b/remove-database.yml @@ -6,7 +6,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -33,10 +33,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -66,7 +66,7 @@ # Deleting databases for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -100,7 +100,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/remove-realm.yml b/remove-realm.yml index 60de498..de6ad30 100644 --- a/remove-realm.yml +++ b/remove-realm.yml @@ -5,7 +5,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -35,10 +35,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -55,7 +55,7 @@ # Deleting client for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false @@ -80,7 +80,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/remove-server.yml b/remove-server.yml index 4d9cbe7..7d2954b 100644 --- a/remove-server.yml +++ b/remove-server.yml @@ -2,7 +2,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -33,10 +33,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -82,7 +82,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/remove-service.yml b/remove-service.yml index b192a30..7a453ff 100644 --- a/remove-service.yml +++ b/remove-service.yml @@ -2,7 +2,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster) @@ -29,10 +29,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -78,7 +78,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/restore-database-backup.yml b/restore-database-backup.yml index 75a0731..703033b 100644 --- a/restore-database-backup.yml +++ b/restore-database-backup.yml @@ -7,7 +7,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_service := (service to setup, e.g. 'connect', ...) @@ -34,10 +34,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -57,7 +57,7 @@ # Restoring databases for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -87,7 +87,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/stage-prodnso b/stage-prodnso index c1e4417..3ea0ca6 100644 --- a/stage-prodnso +++ b/stage-prodnso @@ -1,6 +1,3 @@ -[hcloud_fw] -localhost ansible_connection=local - [awx] prodnso-awx-01 @@ -46,7 +43,7 @@ prodnso-postgres-02 [prometheus] prodnso-prometheus-01 -[peripheral_systems:children] +[stage_prodnso:children] awx connect elastic @@ -62,12 +59,8 @@ postfix postgres prometheus -[stage_prodnso:children] -peripheral_systems -hcloud_fw - [all:children] stage_prodnso [hcloud:children] -peripheral_systems +stage_prodnso diff --git a/update-monitoring.yml b/update-monitoring.yml index 1a007d9..a6fa79d 100644 --- a/update-monitoring.yml +++ b/update-monitoring.yml @@ -4,7 +4,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # smardigo message callback # scope_id := (scope id of the management process) # process_instance_id := (process instance id of the management process) diff --git a/update-service-state.yml b/update-service-state.yml index b343aa6..1eba0ed 100644 --- a/update-service-state.yml +++ b/update-service-state.yml @@ -2,7 +2,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_services := (services to setup, e.g. ['connect', 'wordpress', ...]) @@ -28,10 +28,10 @@ - ansible_version.minor >= 10 msg: "The ansible version has to be at least ({{ ansible_version.full }})" -# add fictive server to load stage specific variables as context for sending smardigo management messages - - name: "Add <{{ stage }}-smardigo-management-message> to hosts" +# add virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-smardigo-management-message" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -48,7 +48,7 @@ # Stopping services for created inventory ############################################################# -- hosts: "stage_{{ stage }}:!{{ stage }}-smardigo-management-message" +- hosts: "stage_{{ stage }}:!{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" remote_user: root vars: @@ -74,7 +74,7 @@ # Sending smardigo management message to process ############################################################# -- hosts: "{{ stage }}-smardigo-management-message" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/update-ssh-config-file.yml b/update-ssh-config-file.yml index 742e61d..613cd02 100644 --- a/update-ssh-config-file.yml +++ b/update-ssh-config-file.yml @@ -2,7 +2,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # username := the default username to use for the ssh connection ############################################################# @@ -21,10 +21,10 @@ - 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 virtual server to load stage specific variables as context + - name: "Add <{{ stage }}-virtual-host-to-read-groups-vars> to hosts" add_host: - name: "{{ stage }}-virtual-smardigo-host" + name: "{{ stage }}-virtual-host-to-read-groups-vars" groups: - "stage_{{ stage }}" changed_when: False @@ -33,7 +33,7 @@ # Updating ssh config for servers with given stage ############################################################# -- hosts: "{{ stage }}-virtual-smardigo-host" +- hosts: "{{ stage }}-virtual-host-to-read-groups-vars" serial: "{{ serial_number | default(1) }}" gather_facts: false connection: local diff --git a/upload-database-dumb.yml b/upload-database-dumb.yml index 70a641f..4ff92eb 100644 --- a/upload-database-dumb.yml +++ b/upload-database-dumb.yml @@ -9,7 +9,7 @@ # Parameters: # playbook inventory -# stage := the type of the stage (e.g. dev, int, qa, prod) +# stage := the name of the stage (e.g. dev, int, qa, prod) # tenant_id := (unique key for the tenant, e.g. customer) # cluster_name := (business name for the cluster, e.g. product, department ) # cluster_size := (WIP node count for the cluster)