diff --git a/playbooks/openshift-node/private/network_manager.yml b/playbooks/openshift-node/private/network_manager.yml index 2638c5223b9..336e0c0efb6 100644 --- a/playbooks/openshift-node/private/network_manager.yml +++ b/playbooks/openshift-node/private/network_manager.yml @@ -3,12 +3,19 @@ hosts: oo_all_hosts become: yes tasks: + - name: Detecting Operating System + shell: ls /run/ostree-booted + ignore_errors: yes + failed_when: false + register: ostree_output + - name: install NetworkManager package: name: 'NetworkManager' state: present register: result until: result is succeeded + when: ostree_output.rc != 0 - name: configure NetworkManager lineinfile: diff --git a/test/ci/deprovision.yml b/test/ci/deprovision.yml index 481dccf2f97..17703bb99f4 100644 --- a/test/ci/deprovision.yml +++ b/test/ci/deprovision.yml @@ -15,20 +15,31 @@ tag-key: "kubernetes.io/cluster/{{ aws_cluster_id }}" register: ec2 - - name: Stop VMs + - name: Terminate instances ec2: instance_ids: "{{ item.instance_id }}" region: "{{ aws_region }}" - state: stopped + state: absent wait: no with_items: "{{ ec2.instances }}" - ignore_errors: true + when: not aws_use_auto_terminator | default(true) - - name: Rename VMs - ec2_tag: - resource: "{{ item.instance_id }}" - region: "{{ aws_region }}" - tags: - Name: "{{ item.tags.Name }}-terminate" - when: "'-terminate' not in item.tags.Name" - with_items: "{{ ec2.instances }}" + - when: aws_use_auto_terminator | default(true) + block: + - name: Stop VMs + ec2: + instance_ids: "{{ item.instance_id }}" + region: "{{ aws_region }}" + state: stopped + wait: no + with_items: "{{ ec2.instances }}" + ignore_errors: true + + - name: Rename VMs + ec2_tag: + resource: "{{ item.instance_id }}" + region: "{{ aws_region }}" + tags: + Name: "{{ item.tags.Name }}-terminate" + when: "'-terminate' not in item.tags.Name" + with_items: "{{ ec2.instances }}" diff --git a/test/ci/launch.yml b/test/ci/launch.yml index 511e43c4393..296651c62b7 100644 --- a/test/ci/launch.yml +++ b/test/ci/launch.yml @@ -76,5 +76,7 @@ - wait_for_connection: {} - setup: {} + +- import_playbook: ../../playbooks/openshift-node/network_manager.yml - import_playbook: ../../playbooks/prerequisites.yml - import_playbook: ../../playbooks/deploy_cluster.yml diff --git a/test/ci/vars.yml.sample b/test/ci/vars.yml.sample index 64354b57d53..3b07aa2d57b 100644 --- a/test/ci/vars.yml.sample +++ b/test/ci/vars.yml.sample @@ -1,9 +1,13 @@ --- vm_prefix: "ci_test" +#aws_use_auto_terminator is set to True by default, as rh-dev account doesn't have permission +# to terminate instances. These should be stopped and renamed to include 'terminate' instead +#aws_use_auto_terminator: false type: aws aws_user: "ec2-user" python: "/usr/bin/python" + aws_key: "libra" aws_region: "us-east-1" aws_cluster_id: "ci"