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_os_client.yaml b/playbooks/local_os_client.yaml index 834c62f..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']" @@ -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/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 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