Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 33d9b56

Browse files
jonesdtrayjh
authored andcommitted
Package Dependency Ansible Tooling: Updated dependency tooling logic updates (#448)
* fix: creates working directory with list of dependent .rpms * refactor: Fixes to dependency tooling ansible playbooks
1 parent c3dac29 commit 33d9b56

5 files changed

+45
-47
lines changed

playbooks/host_vars/localhost

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ python_executable_local: "{{ venv_path_local }}/bin/python"
2323
ssh_key_private: "{{ ansible_env.HOME }}/.ssh/gen"
2424
ssh_key_public: "{{ ssh_key_private }}.pub"
2525
known_hosts: "{{ project_path_local }}/playbooks/known_hosts"
26+
deps_path_local: "{{ project_path_local }}/logs/dependencies"

software/wmla120_ansible/engr_mode_client_post_install_gather.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
- name: Set dependencies directory variable
88
set_fact:
9-
dependencies_dir: "../../logs/dependencies/"
9+
dependencies_dir: "{{ hostvars['localhost']['deps_path_local'] }}"
1010

1111
- name: Get route to client
1212
command: "{{ hostvars['localhost']['python_executable_local'] }} \
@@ -18,23 +18,22 @@
1818
#YUYM
1919
- name: Check that the check if YUM post data exists
2020
stat:
21-
path: "/{{ yum_post }}"
21+
path: "{{ ansible_env.HOME }}/{{ yum_post }}"
2222
register: yum_post_result
2323

2424
- name: Create YUM post data file, if data doesnt exist already on client
25-
shell: "yum list installed | sed 1,2d | xargs -n3 | column -t > \
26-
{{ yum_post }}"
25+
shell: "yum list installed | sed 1,2d | xargs -n3 | column -t > {{ yum_post }}"
2726
when: not yum_post_result.stat.exists
2827

2928
- name: Copy YUM data back to deployer
3029
fetch:
31-
src: "~/{{ yum_post }}"
30+
src: "{{ ansible_env.HOME }}/{{ yum_post }}"
3231
dest: "{{ dependencies_dir }}"
3332

3433
#PIP
3534
- name: Check that the check if PIP post data exists
3635
stat:
37-
path: "/{{ pip_post }}"
36+
path: "{{ ansible_env.HOME }}/{{ pip_post }}"
3837
register: pip_post_result
3938

4039
- name: Create PIP post data file, if data doesnt exist already on client
@@ -43,5 +42,5 @@
4342

4443
- name: Copy PIP data back to deployer
4544
fetch:
46-
src: "~/{{ pip_post }}"
45+
src: "{{ ansible_env.HOME }}/{{ pip_post }}"
4746
dest: "{{ dependencies_dir }}"

software/wmla120_ansible/engr_mode_client_pre_install_gather.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
- name: Set dependencies directory variable
88
set_fact:
9-
dependencies_dir: "../../logs/dependencies/"
9+
dependencies_dir: "{{ hostvars['localhost']['deps_path_local'] }}"
1010

1111
#Create Dependencies Directory
1212
- name: Check that the check if dependencies directory exists
@@ -19,7 +19,6 @@
1919
file:
2020
path: "{{ dependencies_dir }}"
2121
state: directory
22-
owner: jonest
2322
mode: 0777
2423
when: not dep_result.stat.exists
2524
delegate_to: localhost
@@ -34,23 +33,22 @@
3433
#YUM
3534
- name: Check if YUM pre data exists
3635
stat:
37-
path: "~/{{ yum_pre }}"
36+
path: "{{ ansible_env.HOME }}/{{ yum_pre }}"
3837
register: yum_pre_result
3938

4039
- name: Create YUM pre data file, if data doesnt exist already on client
41-
shell: "yum list installed | sed 1,2d | xargs -n3 | column -t > \
42-
{{ yum_pre }}"
40+
shell: "yum list installed | sed 1,2d | xargs -n3 | column -t > {{ yum_pre }}"
4341
when: not yum_pre_result.stat.exists
4442

4543
- name: Copy YUM data back to deployer
4644
fetch:
47-
src: "~/{{ yum_pre }}"
45+
src: "{{ ansible_env.HOME }}/{{ yum_pre }}"
4846
dest: "{{ dependencies_dir }}"
4947

5048
#PIP
5149
- name: Check that the check if PIP pre data exists
5250
stat:
53-
path: "~/{{ pip_pre }}"
51+
path: "{{ ansible_env.HOME }}/{{ pip_pre }}"
5452
register: pip_pre_result
5553

5654
- name: Create PIP pre data file, if data doesnt exist already on client
@@ -59,5 +57,5 @@
5957

6058
- name: Copy PIP data back to deployer
6159
fetch:
62-
src: "~/{{ pip_pre }}"
60+
src: "{{ ansible_env.HOME }}/{{ pip_pre }}"
6361
dest: "{{ dependencies_dir }}"

software/wmla120_ansible/engr_mode_env_post_install_gather.yml

+15-16
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
dlipy3_conda: dlipy3_conda_post_install.txt
66
dlipy2_pip: dlipy2_pip_post_install.txt
77
dlipy2_conda: dlipy2_conda_post_install.txt
8-
dliinsights_pip: dlinsights_pip_post_install.txt
9-
dliinsights_conda: dlinsights_conda_post_install.txt
8+
dlinsights_pip: dlinsights_pip_post_install.txt
9+
dlinsights_conda: dlinsights_conda_post_install.txt
1010

1111
- name: Set dependencies directory variable
1212
set_fact:
13-
dependencies_dir: "../../logs/dependencies/"
13+
dependencies_dir: "{{ hostvars['localhost']['deps_path_local'] }}"
1414

1515
- name: Set installation directory variable
1616
set_fact:
@@ -27,7 +27,7 @@
2727

2828
- name: Check if dlipy3 post data exists (PIP)
2929
stat:
30-
path: "~/{{ dlipy3_pip }}"
30+
path: "{{ ansible_env.HOME }}/{{ dlipy3_pip }}"
3131
register: dlipy3_pip_result
3232

3333
- name: Activate dlipy3 environment and gather post data (PIP)
@@ -39,13 +39,13 @@
3939

4040
- name: Copy data back to deployer (PIP)
4141
fetch:
42-
src: "~/{{ dlipy3_pip }}"
42+
src: "{{ ansible_env.HOME }}/{{ dlipy3_pip }}"
4343
dest: "{{ dependencies_dir }}"
4444
when: not dlipy3_pip_result.stat.exists
4545

4646
- name: Check if dlipy3 post data exists (Conda)
4747
stat:
48-
path: "~/{{ dlipy3_conda }}"
48+
path: "{{ ansible_env.HOME }}/{{ dlipy3_conda }}"
4949
register: dlipy3_conda_result
5050

5151
- name: Activate dlipy3 environment and gather post data (Conda)
@@ -57,15 +57,15 @@
5757

5858
- name: Copy data back to deployer (Conda)
5959
fetch:
60-
src: "~/{{ dlipy3_conda }}"
60+
src: "{{ ansible_env.HOME }}/{{ dlipy3_conda }}"
6161
dest: "{{ dependencies_dir }}"
6262
when: not dlipy3_conda_result.stat.exists
6363

6464
#dlipy2 env
6565

6666
- name: Check if dlipy2 post data exists (PIP)
6767
stat:
68-
path: "~/{{ dlipy2_pip }}"
68+
path: "{{ ansible_env.HOME }}/{{ dlipy2_pip }}"
6969
register: dlipy2_pip_result
7070

7171
- name: Activate dlipy2 environment and gather post data (PIP)
@@ -74,16 +74,15 @@
7474
- "conda list --explicit > {{ vars.dlipy2_pip }}"
7575
become: yes
7676
when: not dlipy2_pip_result.stat.exists
77-
7877
- name: Copy data back to deployer (PIP)
7978
fetch:
80-
src: "~/{{ dlipy2_pip }}"
79+
src: "{{ ansible_env.HOME }}/{{ dlipy2_pip }}"
8180
dest: "{{ dependencies_dir }}"
8281
when: not dlipy2_pip_result.stat.exists
8382

8483
- name: Check if dlipy2 post data exists (Conda)
8584
stat:
86-
path: "~/{{ dlipy2_conda }}"
85+
path: "{{ ansible_env.HOME }}/{{ dlipy2_conda }}"
8786
register: dlipy2_conda_result
8887

8988
- name: Activate dlipy2 environment and gather post data (Conda)
@@ -95,15 +94,15 @@
9594

9695
- name: Copy data back to deployer (Conda)
9796
fetch:
98-
src: "~/{{ dlipy2_conda }}"
97+
src: "{{ ansible_env.HOME }}/{{ dlipy2_conda }}"
9998
dest: "{{ dependencies_dir }}"
10099
when: not dlipy2_conda_result.stat.exists
101100

102101
#dlinsights env
103102

104103
- name: Check if dlinsights post data exists (PIP)
105104
stat:
106-
path: "~/{{ dlinsights_pip }}"
105+
path: "{{ ansible_env.HOME }}/{{ dlinsights_pip }}"
107106
register: dlinsights_pip_result
108107

109108
- name: Activate dlinsights and gather post data (PIP)
@@ -115,13 +114,13 @@
115114

116115
- name: Copy data back to deployer (PIP)
117116
fetch:
118-
src: "~/{{ dlinsights_pip }}"
117+
src: "{{ ansible_env.HOME }}/{{ dlinsights_pip }}"
119118
dest: "{{ dependencies_dir }}"
120119
when: not dlinsights_pip_result.stat.exists
121120

122121
- name: Check if dlinsights post data exists (Conda)
123122
stat:
124-
path: "~/{{ dlinsights_conda }}"
123+
path: "{{ ansible_env.HOME }}/{{ dlinsights_conda }}"
125124
register: dlinsights_conda_result
126125

127126
- name: Activate dlinsights and gather post data (Conda)
@@ -133,7 +132,7 @@
133132

134133
- name: Copy data back to deployer (Conda)
135134
fetch:
136-
src: "~/{{ dlinsights_conda }}"
135+
src: "{{ ansible_env.HOME }}/{{ dlinsights_conda }}"
137136
dest: "{{ dependencies_dir }}"
138137
when: not dlinsights_conda_result.stat.exists
139138

software/wmla120_ansible/engr_mode_env_pre_install_gather.yml

+17-16
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
dlipy3_conda: dlipy3_conda_pre_install.txt
66
dlipy2_pip: dlipy2_pip_pre_install.txt
77
dlipy2_conda: dlipy2_conda_pre_install.txt
8-
dliinsights_pip: dlinsights_pip_pre_install.txt
9-
dliinsights_conda: dlinsights_conda_pre_install.txt
8+
dlinsights_pip: dlinsights_pip_pre_install.txt
9+
dlinsights_conda: dlinsights_conda_pre_install.txt
1010

1111
- name: Set dependencies directory variable
1212
set_fact:
13-
dependencies_dir: "../../logs/dependencies/"
13+
dependencies_dir: "{{ hostvars['localhost']['deps_path_local'] }}"
1414

1515
- name: Set installation directory variable
1616
set_fact:
@@ -38,7 +38,7 @@
3838

3939
- name: Check if dlipy3 pre data exists (PIP)
4040
stat:
41-
path: "~/{{ dlipy3_pip }}"
41+
path: "{{ ansible_env.HOME }}/{{ dlipy3_pip }}"
4242
register: dlipy3_pip_result
4343

4444
- name: Activate dlipy3_test environment and gather pre data (PIP)
@@ -50,13 +50,13 @@
5050

5151
- name: Copy data back to deployer (PIP)
5252
fetch:
53-
src: "~/{{ dlipy3_pip }}"
53+
src: "{{ ansible_env.HOME }}/{{ dlipy3_pip }}"
5454
dest: "{{ dependencies_dir }}"
5555
when: not dlipy3_pip_result.stat.exists
5656

5757
- name: Check if dlipy3 pre data exists (Conda)
5858
stat:
59-
path: "~/{{ dlipy3_conda }}"
59+
path: "{{ ansible_env.HOME }}/{{ dlipy3_conda }}"
6060
register: dlipy3_conda_result
6161

6262
- name: Activate dlipy3_test environment and gather pre data (Conda)
@@ -68,10 +68,11 @@
6868

6969
- name: Copy data back to deployer (Conda)
7070
fetch:
71-
src: "~/{{ dlipy3_conda }}"
71+
src: "{{ ansible_env.HOME }}/{{ dlipy3_conda }}"
7272
dest: "{{ dependencies_dir }}"
7373
when: not dlipy3_conda_result.stat.exists
74-
#dlipy2 env
74+
75+
#dlipy2 env
7576

7677
- name: Check if Anaconda dlipy2_test environment already exists
7778
stat:
@@ -86,7 +87,7 @@
8687

8788
- name: Check if dlipy2 pre data exists (PIP)
8889
stat:
89-
path: "~/{{ dlipy2_pip }}"
90+
path: "{{ ansible_env.HOME }}/{{ dlipy2_pip }}"
9091
register: dlipy2_pip_result
9192

9293
- name: Activate dlipy2_test environment and gather pre data (PIP)
@@ -98,13 +99,13 @@
9899

99100
- name: Copy data back to deployer (PIP)
100101
fetch:
101-
src: "~/{{ dlipy2_pip }}"
102+
src: "{{ ansible_env.HOME }}/{{ dlipy2_pip }}"
102103
dest: "{{ dependencies_dir }}"
103104
when: not dlipy2_pip_result.stat.exists
104105

105106
- name: Check if dlipy2 pre data exists (Conda)
106107
stat:
107-
path: "~/{{ dlipy2_conda }}"
108+
path: "{{ ansible_env.HOME }}/{{ dlipy2_conda }}"
108109
register: dlipy2_conda_result
109110

110111
- name: Activate dlipy2_test environment and gather pre data (Conda)
@@ -116,7 +117,7 @@
116117

117118
- name: Copy data back to deployer (Conda)
118119
fetch:
119-
src: "~/{{ dlipy2_conda }}"
120+
src: "{{ ansible_env.HOME }}/{{ dlipy2_conda }}"
120121
dest: "{{ dependencies_dir }}"
121122
when: not dlipy2_conda_result.stat.exists
122123

@@ -135,7 +136,7 @@
135136

136137
- name: Check if dlinsights pre data exists (PIP)
137138
stat:
138-
path: "~/{{ dlinsights_pip }}"
139+
path: "{{ ansible_env.HOME }}/{{ dlinsights_pip }}"
139140
register: dlinsights_pip_result
140141

141142
- name: Activate dlinsights and gather pre data (PIP)
@@ -147,13 +148,13 @@
147148

148149
- name: Copy data back to deployer (PIP)
149150
fetch:
150-
src: "~/{{ dlinsights_pip }}"
151+
src: "{{ ansible_env.HOME }}/{{ dlinsights_pip }}"
151152
dest: "{{ dependencies_dir }}"
152153
when: not dlinsights_pip_result.stat.exists
153154

154155
- name: Check if dlinsights pre data exists (Conda)
155156
stat:
156-
path: "~/{{ dlinsights_conda }}"
157+
path: "{{ ansible_env.HOME }}/{{ dlinsights_conda }}"
157158
register: dlinsights_conda_result
158159

159160
- name: Activate dlinsights and gather pre data (Conda)
@@ -165,7 +166,7 @@
165166

166167
- name: Copy data back to deployer (Conda)
167168
fetch:
168-
src: "~/{{ dlinsights_conda }}"
169+
src: "{{ ansible_env.HOME }}/{{ dlinsights_conda }}"
169170
dest: "{{ dependencies_dir }}"
170171
when: not dlinsights_conda_result.stat.exists
171172

0 commit comments

Comments
 (0)