|
| 1 | +--- |
| 2 | + |
1 | 3 | # Copyright 2023 Cloudera, Inc. |
2 | 4 | # |
3 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
|
12 | 14 | # See the License for the specific language governing permissions and |
13 | 15 | # limitations under the License. |
14 | 16 |
|
15 | | ---- |
16 | | - |
17 | 17 | - name: Fail Fast if ECS OS is not RH family |
18 | | - fail: |
| 18 | + ansible.builtin.fail: |
19 | 19 | msg: ECS is not supported on this OS, should be Centos or RHEL |
20 | 20 | when: ansible_os_family != 'RedHat' |
21 | 21 |
|
| 22 | +- name: Populate service facts |
| 23 | + ansible.builtin.service_facts: |
| 24 | + |
22 | 25 | - name: Install necessary additional packages |
23 | 26 | ansible.builtin.package: |
24 | 27 | name: "{{ __package_item }}" |
|
47 | 50 | when: ansible_distribution_major_version | int >= 8 |
48 | 51 | block: |
49 | 52 | - name: Install iptables for rhel8, using rpm option tsflags=noscripts |
50 | | - command: dnf install -y iptables --setopt=tsflags=noscripts |
51 | | - |
| 53 | + ansible.builtin.command: dnf install -y iptables --setopt=tsflags=noscripts |
52 | 54 |
|
53 | 55 | - name: Flush iptables |
54 | 56 | ansible.builtin.iptables: |
|
65 | 67 |
|
66 | 68 | ## see https://docs.rke2.io/known_issues |
67 | 69 | - name: Set NetworkManager to ignore any ECS calico & flannel interfaces |
68 | | - copy: |
| 70 | + ansible.builtin.copy: |
69 | 71 | src: networkmanager.conf |
70 | 72 | dest: /etc/NetworkManager/conf.d/rke2-canal.config |
71 | 73 | owner: root |
72 | 74 | group: root |
73 | 75 | mode: 0644 |
74 | 76 | when: |
75 | | - - ansible_distribution_major_version|int >= 7 |
76 | | - - ansible_facts.services['NetworkManager.service'] is defined |
| 77 | + - ansible_distribution_major_version|int >= 7 |
| 78 | + - ansible_facts.services["NetworkManager.service"]['status'] != "not-found" |
77 | 79 |
|
78 | 80 | - name: Reload NetworkManager daemon |
79 | | - systemd: |
| 81 | + ansible.builtin.service: |
80 | 82 | state: restarted |
81 | 83 | daemon_reload: true |
82 | 84 | name: NetworkManager.service |
83 | 85 | when: |
84 | | - - ansible_distribution_major_version|int >= 7 |
85 | | - - ansible_facts.services['NetworkManager.service'] is defined |
86 | | - |
| 86 | + - ansible_distribution_major_version|int >= 7 |
| 87 | + - ansible_facts.services["NetworkManager.service"]['status'] != "not-found" |
0 commit comments