|
1 | | -- name: openhpc-lenovo-jenkins-sms |
2 | | - hosts: openhpc_lenovo_jenkins_sms |
3 | | - gather_facts: True |
| 1 | +- name: Configure ohpc-lenovo-sms |
| 2 | + hosts: ohpc_lenovo_sms |
| 3 | + gather_facts: true |
| 4 | + handlers: |
| 5 | + - name: Include handlers |
| 6 | + ansible.builtin.import_tasks: ../common/handlers.yml |
| 7 | + |
4 | 8 | tasks: |
5 | | - - name: configure proxy |
6 | | - copy: |
7 | | - dest: /etc/profile.d/proxy.sh |
8 | | - content: | |
9 | | - export https_proxy=http://10.241.58.130:3128 |
10 | | - export http_proxy=http://10.241.58.130:3128 |
| 9 | + - name: Include history.yml |
| 10 | + ansible.builtin.include_tasks: ../common/history.yml |
11 | 11 |
|
12 | | - - name: fix dnf.conf |
13 | | - ansible.builtin.lineinfile: |
14 | | - path: /etc/dnf/dnf.conf |
15 | | - line: "{{ item }}" |
16 | | - with_items: |
17 | | - - user_agent="curl" |
18 | | - when: (distro.startswith("rocky")) or (distro == "almalinux9") or (distro.startswith("openEuler")) |
| 12 | + - name: Configure proxy |
| 13 | + ansible.builtin.copy: |
| 14 | + dest: /etc/profile.d/proxy.sh |
| 15 | + owner: root |
| 16 | + group: root |
| 17 | + mode: "0644" |
| 18 | + content: | |
| 19 | + export https_proxy=http://10.241.58.130:3128 |
| 20 | + export http_proxy=http://10.241.58.130:3128 |
19 | 21 |
|
20 | | - - name: Replace mirror URL for openeuler |
21 | | - ansible.builtin.replace: |
22 | | - path: /etc/yum.repos.d/openEuler.repo |
23 | | - regexp: 'repo.openeuler.org' |
24 | | - replace: 'repo.huaweicloud.com/openeuler' |
25 | | - when: distro == "openEuler_22.03" |
| 22 | + - name: Fix dnf.conf |
| 23 | + ansible.builtin.lineinfile: |
| 24 | + path: /etc/dnf/dnf.conf |
| 25 | + line: "{{ item }}" |
| 26 | + with_items: |
| 27 | + - user_agent="curl" |
| 28 | + when: (distro.startswith("rocky")) or (distro == "almalinux9") or (distro.startswith("openEuler")) |
26 | 29 |
|
27 | | - - name: install obs repository configuration |
28 | | - template: |
29 | | - src: "{{ item }}" |
30 | | - dest: /etc/yum.repos.d/ |
31 | | - owner: root |
32 | | - group: root |
33 | | - mode: 0644 |
34 | | - with_items: |
35 | | - - OpenHPC-obs-factory.repo |
36 | | - when: distro == "openEuler_22.03" |
| 30 | + - name: Replace mirror URL for openeuler |
| 31 | + ansible.builtin.replace: |
| 32 | + path: /etc/yum.repos.d/openEuler.repo |
| 33 | + regexp: 'repo.openeuler.org' |
| 34 | + replace: 'repo.huaweicloud.com/openeuler' |
| 35 | + when: distro == "openEuler_22.03" |
37 | 36 |
|
38 | | - - name: install obs repository configuration |
39 | | - copy: |
40 | | - src: "{{ item }}" |
41 | | - dest: /etc/yum.repos.d/ |
42 | | - owner: root |
43 | | - group: root |
44 | | - mode: 0644 |
45 | | - with_items: |
46 | | - - mgrigorov-OpenHPC-openeuler-22.03_LTS_SP3.repo |
47 | | - when: distro == "openEuler_22.03" |
| 37 | + - name: Install obs repository configuration |
| 38 | + ansible.builtin.template: |
| 39 | + src: "{{ item }}" |
| 40 | + dest: /etc/yum.repos.d/ |
| 41 | + owner: root |
| 42 | + group: root |
| 43 | + mode: "0644" |
| 44 | + with_items: |
| 45 | + - OpenHPC-obs-factory.repo |
| 46 | + when: distro == "openEuler_22.03" |
48 | 47 |
|
49 | | - - name: install obs repository configuration |
50 | | - template: |
51 | | - src: "{{ item }}" |
52 | | - dest: /etc/yum.repos.d/ |
53 | | - owner: root |
54 | | - group: root |
55 | | - mode: 0644 |
56 | | - with_items: |
57 | | - - OpenHPC-obs-factory.repo |
58 | | - when: (distro.startswith("rocky")) or (distro == "almalinux9") |
| 48 | + - name: Install obs repository configuration |
| 49 | + ansible.builtin.copy: |
| 50 | + src: "{{ item }}" |
| 51 | + dest: /etc/yum.repos.d/ |
| 52 | + owner: root |
| 53 | + group: root |
| 54 | + mode: "0644" |
| 55 | + with_items: |
| 56 | + - mgrigorov-OpenHPC-openeuler-22.03_LTS_SP3.repo |
| 57 | + when: distro == "openEuler_22.03" |
59 | 58 |
|
60 | | - - name: install obs repository configuration |
61 | | - template: |
62 | | - src: "{{ item }}" |
63 | | - dest: /etc/zypp/repos.d/ |
64 | | - owner: root |
65 | | - group: root |
66 | | - mode: 0644 |
67 | | - with_items: |
68 | | - - OpenHPC-obs-factory.repo |
69 | | - when: distro.startswith("leap15") |
| 59 | + - name: Install obs repository configuration |
| 60 | + ansible.builtin.template: |
| 61 | + src: "{{ item }}" |
| 62 | + dest: /etc/yum.repos.d/ |
| 63 | + owner: root |
| 64 | + group: root |
| 65 | + mode: "0644" |
| 66 | + with_items: |
| 67 | + - OpenHPC-obs-factory.repo |
| 68 | + when: (distro.startswith("rocky")) or (distro == "almalinux9") |
70 | 69 |
|
71 | | - - name: install packages |
72 | | - package: |
73 | | - state: present |
74 | | - name: |
75 | | - - epel-release |
76 | | - - tzdata-java |
77 | | - when: (distro.startswith("rocky")) or (distro == "almalinux9") |
| 70 | + - name: Install obs repository configuration |
| 71 | + ansible.builtin.template: |
| 72 | + src: "{{ item }}" |
| 73 | + dest: /etc/zypp/repos.d/ |
| 74 | + owner: root |
| 75 | + group: root |
| 76 | + mode: "0644" |
| 77 | + with_items: |
| 78 | + - OpenHPC-obs-factory.repo |
| 79 | + when: distro.startswith("leap15") |
78 | 80 |
|
79 | | - - name: install packages |
80 | | - package: |
81 | | - state: present |
82 | | - name: |
83 | | - - git |
84 | | - - ipmitool |
85 | | - - rsync |
86 | | - - chrony |
87 | | - - bats |
88 | | - when: distro != "leap15.3" |
| 81 | + - name: Install packages |
| 82 | + ansible.builtin.package: |
| 83 | + state: present |
| 84 | + name: |
| 85 | + - epel-release |
| 86 | + - tzdata-java |
| 87 | + when: (distro.startswith("rocky")) or (distro == "almalinux9") |
89 | 88 |
|
90 | | - - import_tasks: ohpc-lenovo-common.yml |
| 89 | + - name: Install packages |
| 90 | + ansible.builtin.package: |
| 91 | + state: present |
| 92 | + name: |
| 93 | + - git |
| 94 | + - ipmitool |
| 95 | + - rsync |
| 96 | + - chrony |
| 97 | + - bats |
| 98 | + when: distro != "leap15.3" |
91 | 99 |
|
92 | | - - name: create directories |
93 | | - file: dest="{{item}}" state=directory |
94 | | - with_items: |
95 | | - - /root/ci |
| 100 | + - name: Import ohpc-lenovo-common.yml |
| 101 | + ansible.builtin.import_tasks: ohpc-lenovo-common.yml |
96 | 102 |
|
97 | | - - name: copy helper scripts |
98 | | - copy: |
99 | | - src: "{{ item }}" |
100 | | - dest: /root/ci/ |
101 | | - owner: root |
102 | | - group: root |
103 | | - with_items: |
104 | | - - install.sh |
105 | | - - support_functions.sh |
106 | | - - computes_installed.py |
107 | | - - sms_installed.bats |
108 | | - - gen_inputs.pl |
| 103 | + - name: Create directories |
| 104 | + ansible.builtin.file: |
| 105 | + dest: "{{ item }}" |
| 106 | + state: directory |
| 107 | + mode: "0755" |
| 108 | + with_items: |
| 109 | + - /root/ci |
109 | 110 |
|
110 | | - - name: copy helper scripts |
111 | | - template: |
112 | | - src: "{{ item }}" |
113 | | - dest: /root/ci/ |
114 | | - owner: root |
115 | | - group: root |
116 | | - with_items: |
117 | | - - lenovo.mapping |
| 111 | + - name: Copy helper scripts |
| 112 | + ansible.builtin.copy: |
| 113 | + src: "{{ item }}" |
| 114 | + dest: /root/ci/ |
| 115 | + owner: root |
| 116 | + group: root |
| 117 | + mode: "0644" |
| 118 | + with_items: |
| 119 | + - install.sh |
| 120 | + - support_functions.sh |
| 121 | + - computes_installed.py |
| 122 | + - sms_installed.bats |
| 123 | + - gen_inputs.pl |
| 124 | + - lenovo.mapping |
118 | 125 |
|
119 | | - - name: make install script executable |
120 | | - ansible.builtin.file: |
121 | | - path: "/root/ci/{{ item }}" |
122 | | - mode: '0755' |
123 | | - with_items: |
124 | | - - install.sh |
125 | | - - sms_installed.bats |
| 126 | + - name: Make install script executable |
| 127 | + ansible.builtin.file: |
| 128 | + path: "/root/ci/{{ item }}" |
| 129 | + mode: '0755' |
| 130 | + with_items: |
| 131 | + - install.sh |
| 132 | + - sms_installed.bats |
0 commit comments