From c1fca3a1ef51d9abe4cbbc9eb89071261bfd15ce Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 5 Mar 2025 17:35:22 +0000 Subject: [PATCH 1/3] Install required packages locally Signed-off-by: Stephen Finucane --- README.md | 2 +- playbooks/local_requirements.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 959ee2b..9884d56 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ * An appropriate OS has already been installed * EPEL repositories aren't deployed, they aren't compatible with OpenStack repositories * The machine running `dev-install` can SSH to the standalone host as either root or a user with passwordless sudo access -* This machine has Ansible installed, and some dependencies like `python3-netaddr`. +* This machine has Ansible installed. Additional dependencies like `python3-netaddr` will be installed automatically. You need to deploy the right RHEL version depending on which OSP version you want: diff --git a/playbooks/local_requirements.yaml b/playbooks/local_requirements.yaml index a8c4997..597cbdc 100644 --- a/playbooks/local_requirements.yaml +++ b/playbooks/local_requirements.yaml @@ -7,3 +7,14 @@ roles: - operators - rhsm +- hosts: localhost + connection: local + become: true + name: Install dependencies for other playbooks + tasks: + - name: Install packages + ansible.builtin.package: + name: + - python3-jmespath + - python3-netaddr + state: installed From b22b697447e8dba31e188853652b155599f193bc Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 6 Mar 2025 10:47:05 +0000 Subject: [PATCH 2/3] Install OSC from dnf, not pip Signed-off-by: Stephen Finucane --- playbooks/local_os_client.yaml | 4 ++-- playbooks/vars/defaults.yaml | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/playbooks/local_os_client.yaml b/playbooks/local_os_client.yaml index 834c62f..9767580 100644 --- a/playbooks/local_os_client.yaml +++ b/playbooks/local_os_client.yaml @@ -116,9 +116,9 @@ mode: '0755' - name: Install openstack client locally - ansible.builtin.pip: + become: true + ansible.builtin.package: name: python-openstackclient - extra_args: "{% if not is_local_virtualenv %} --user {% endif %}" - name: Create the scripts if it does not exist ansible.builtin.file: diff --git a/playbooks/vars/defaults.yaml b/playbooks/vars/defaults.yaml index d89a97c..d64c66b 100644 --- a/playbooks/vars/defaults.yaml +++ b/playbooks/vars/defaults.yaml @@ -3,9 +3,6 @@ rhos_release: 17.1 hostname: standalone clouddomain: shiftstack -# is ansible running in a virtualenv on the control node -is_local_virtualenv: "{{ lookup('env', 'VIRTUAL_ENV') | default('', true) }}" - # The name of the cloud in *local* clouds.yaml. On the host it will always be # called `standalone`. local_cloudname: standalone From 6f49eab811e4271bca5f78e3d9ae8681ca196e99 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 6 Mar 2025 15:10:29 +0000 Subject: [PATCH 3/3] Invert cloud names The non-privileged cloud is the more useful one and should be shorter. Reverse the names. Signed-off-by: Stephen Finucane --- playbooks/local_os_client.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/local_os_client.yaml b/playbooks/local_os_client.yaml index 9767580..431ef04 100644 --- a/playbooks/local_os_client.yaml +++ b/playbooks/local_os_client.yaml @@ -97,14 +97,14 @@ - name: Merge standalone from remote clouds.yaml into local clouds.yaml entry {{ local_cloudname }} ansible.builtin.set_fact: - cloudsyaml: "{{ cloudsyaml | combine({'clouds': {local_cloudname: standalone}}, recursive=true) }}" + cloudsyaml: "{{ cloudsyaml | combine({'clouds': {local_cloudname + '-admin': standalone}}, recursive=true) }}" vars: standalone: "{{ hostvars['standalone']['cloudsyaml']['clouds']['standalone'] | combine(set_cacert) }}" when: "'standalone' in hostvars['standalone']['cloudsyaml']['clouds']" - name: Merge openshift from remote clouds.yaml into local clouds.yaml entry {{ local_cloudname }} ansible.builtin.set_fact: - cloudsyaml: "{{ cloudsyaml | combine({'clouds': {local_cloudname + '_openshift': openshift}}, set_cacert, recursive=true) }}" + cloudsyaml: "{{ cloudsyaml | combine({'clouds': {local_cloudname: openshift}}, set_cacert, recursive=true) }}" vars: openshift: "{{ hostvars['standalone']['cloudsyaml']['clouds']['openshift'] | combine(set_cacert) }}" when: "'openshift' in hostvars['standalone']['cloudsyaml']['clouds']"