Skip to content

force bastion-ansible.sh to be run after replacing an infra node #383

Description

@ioggstream

when

  • I replace an infra node

I expect

bastion-ansible.sh to be run

instead

it is not run

idea

injecting infra host-id into node.yaml:run_ansible I can notify if an infra node have been replaced.

This will trigger bastion-ansible.sh / ansible-playbook main.yaml that will reconfigure the node.

Do you see any drawback?

diff --git a/node.yaml b/node.yaml
index 91fb064..4c20b55 100644
--- a/node.yaml
+++ b/node.yaml
@@ -419,6 +419,10 @@ parameters:
     type: boolean
     description: Enable http authentication or use another backend via extra_openshift_ansible_params.
     default: true
+
+  all_infra_ids:
+    type: string
+    description: A list of server ids

 conditions:
   root_volume: false
@@ -834,6 +838,8 @@ resources:
           default: {get_param: internal_subnet}
         - name: fixed_subnet
           default: {get_param: fixed_subnet}
+        - name: all_infra_ids
+          default: {get_param: all_infra_ids}
       outputs:
         - name: ca_cert
         - name: ca_key
diff --git a/openshift.yaml b/openshift.yaml
index ba8c6c8..b9ba120 100644
--- a/openshift.yaml
+++ b/openshift.yaml
@@ -893,6 +893,10 @@ resources:
             list_join:
               - " "
               - {get_attr: [openshift_infra_nodes, hostname]}
+          all_infra_ids:
+            list_join:
+              - " "
+              - {get_attr: [openshift_infra_nodes, host]}
           container_quota: {get_param: container_quota}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions