From e8914d0a6a61d3dbf7ef48c04584428d0c346c1e Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 11 Aug 2023 09:56:35 +1000 Subject: [PATCH 1/7] found another task that is failing, testing out omit here --- roles/linux_common/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/linux_common/tasks/main.yml b/roles/linux_common/tasks/main.yml index 6155140..796793a 100644 --- a/roles/linux_common/tasks/main.yml +++ b/roles/linux_common/tasks/main.yml @@ -18,6 +18,8 @@ - curl - unzip - fontconfig + vars: + ansible_python_interpreter: "{{ '/usr/bin/python2' if ((ansible_distribution | lower == 'amazon') and (ansible_distribution_version == '2')) else omit }}" - name: Create product group ansible.builtin.group: From 7fefd0ae3dd20bf7ff316748372d18fc821b1964 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 11 Aug 2023 10:04:18 +1000 Subject: [PATCH 2/7] default to pipenv_venv --- roles/linux_common/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/linux_common/tasks/main.yml b/roles/linux_common/tasks/main.yml index 796793a..2c631c9 100644 --- a/roles/linux_common/tasks/main.yml +++ b/roles/linux_common/tasks/main.yml @@ -19,7 +19,7 @@ - unzip - fontconfig vars: - ansible_python_interpreter: "{{ '/usr/bin/python2' if ((ansible_distribution | lower == 'amazon') and (ansible_distribution_version == '2')) else omit }}" + ansible_python_interpreter: "{{ '/usr/bin/python2' if ((ansible_distribution | lower == 'amazon') and (ansible_distribution_version == '2')) else pipenv_venv }}" - name: Create product group ansible.builtin.group: From aaf54f389c6fbf03ad7ecaaf96cc968d6f0bfcd6 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 11 Aug 2023 10:12:09 +1000 Subject: [PATCH 3/7] molecule doesn't use the wrapper scripts, can I default a variable to itself? --- roles/linux_common/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/linux_common/tasks/main.yml b/roles/linux_common/tasks/main.yml index 2c631c9..614cd1f 100644 --- a/roles/linux_common/tasks/main.yml +++ b/roles/linux_common/tasks/main.yml @@ -19,7 +19,7 @@ - unzip - fontconfig vars: - ansible_python_interpreter: "{{ '/usr/bin/python2' if ((ansible_distribution | lower == 'amazon') and (ansible_distribution_version == '2')) else pipenv_venv }}" + ansible_python_interpreter: "{{ '/usr/bin/python2' if ((ansible_distribution | lower == 'amazon') and (ansible_distribution_version == '2')) else ansible_python_interpreter }}" - name: Create product group ansible.builtin.group: From edc77e99a6fc21e1466ba6323a69a2a7917cb0d7 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 11 Aug 2023 10:19:52 +1000 Subject: [PATCH 4/7] no, can't reference itself, add pipenv_venv to inventory vars --- group_vars/aws_node_local.yml | 3 ++- roles/linux_common/tasks/main.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/group_vars/aws_node_local.yml b/group_vars/aws_node_local.yml index e00bd65..4e6dcff 100644 --- a/group_vars/aws_node_local.yml +++ b/group_vars/aws_node_local.yml @@ -9,7 +9,8 @@ # # https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html -ansible_python_interpreter: "{{ pipenv_venv | default('/usr/bin/python') }}" +pipenv_venv: /usr/bin/python # this will get overridden by the wrapper scripts, but should allow molecule to run +ansible_python_interpreter: "{{ pipenv_venv }}" java_major_version: "8" postgres_version: "9.6" diff --git a/roles/linux_common/tasks/main.yml b/roles/linux_common/tasks/main.yml index 614cd1f..2c631c9 100644 --- a/roles/linux_common/tasks/main.yml +++ b/roles/linux_common/tasks/main.yml @@ -19,7 +19,7 @@ - unzip - fontconfig vars: - ansible_python_interpreter: "{{ '/usr/bin/python2' if ((ansible_distribution | lower == 'amazon') and (ansible_distribution_version == '2')) else ansible_python_interpreter }}" + ansible_python_interpreter: "{{ '/usr/bin/python2' if ((ansible_distribution | lower == 'amazon') and (ansible_distribution_version == '2')) else pipenv_venv }}" - name: Create product group ansible.builtin.group: From f33710c0bf797fcfaaeff0a7b3c99503befe84db Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 11 Aug 2023 10:50:57 +1000 Subject: [PATCH 5/7] adding the variable to molecule --- group_vars/aws_node_local.yml | 2 +- roles/linux_common/molecule/default/converge.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/group_vars/aws_node_local.yml b/group_vars/aws_node_local.yml index 4e6dcff..33c170f 100644 --- a/group_vars/aws_node_local.yml +++ b/group_vars/aws_node_local.yml @@ -9,7 +9,7 @@ # # https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html -pipenv_venv: /usr/bin/python # this will get overridden by the wrapper scripts, but should allow molecule to run +pipenv_venv: /usr/bin/python3 # this will get overridden by the wrapper scripts, but should allow molecule to run ansible_python_interpreter: "{{ pipenv_venv }}" java_major_version: "8" diff --git a/roles/linux_common/molecule/default/converge.yml b/roles/linux_common/molecule/default/converge.yml index 22677b5..6f6659a 100644 --- a/roles/linux_common/molecule/default/converge.yml +++ b/roles/linux_common/molecule/default/converge.yml @@ -3,5 +3,6 @@ hosts: all vars: atl_product_user: "jira" + pipenv_venv: "/usr/bin/python3" roles: - role: linux_common From 21a5c0e17ca6cb61c5924270d6c4ac87196ccbb8 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 11 Aug 2023 10:59:27 +1000 Subject: [PATCH 6/7] adding the variable to molecule --- group_vars/aws_node_local.yml | 2 +- roles/linux_common/molecule/default/converge.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/group_vars/aws_node_local.yml b/group_vars/aws_node_local.yml index 33c170f..4e6dcff 100644 --- a/group_vars/aws_node_local.yml +++ b/group_vars/aws_node_local.yml @@ -9,7 +9,7 @@ # # https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html -pipenv_venv: /usr/bin/python3 # this will get overridden by the wrapper scripts, but should allow molecule to run +pipenv_venv: /usr/bin/python # this will get overridden by the wrapper scripts, but should allow molecule to run ansible_python_interpreter: "{{ pipenv_venv }}" java_major_version: "8" diff --git a/roles/linux_common/molecule/default/converge.yml b/roles/linux_common/molecule/default/converge.yml index 6f6659a..cfbd05c 100644 --- a/roles/linux_common/molecule/default/converge.yml +++ b/roles/linux_common/molecule/default/converge.yml @@ -3,6 +3,6 @@ hosts: all vars: atl_product_user: "jira" - pipenv_venv: "/usr/bin/python3" + pipenv_venv: "/usr/bin/python" roles: - role: linux_common From 5a11d939228ae89d0d10e791d0f42630460c6c8a Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 11 Aug 2023 11:28:39 +1000 Subject: [PATCH 7/7] working through pipelines errors --- roles/linux_common/defaults/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/linux_common/defaults/main.yml b/roles/linux_common/defaults/main.yml index cb751b1..fb0d831 100644 --- a/roles/linux_common/defaults/main.yml +++ b/roles/linux_common/defaults/main.yml @@ -2,3 +2,4 @@ atl_product_user_uid: '2001' git_version: "2.14.4" +pipenv_venv: "/usr/bin/python" \ No newline at end of file