diff --git a/ansible/roles/ironic-inspector-rules/meta/main.yml b/ansible/roles/ironic-inspector-rules/meta/main.yml new file mode 100644 index 000000000..b3c8684f5 --- /dev/null +++ b/ansible/roles/ironic-inspector-rules/meta/main.yml @@ -0,0 +1,4 @@ +--- +dependencies: + - role: shade + shade_venv: "{{ ironic_inspector_venv }}" diff --git a/ansible/roles/ironic-inspector-rules/tasks/main.yml b/ansible/roles/ironic-inspector-rules/tasks/main.yml index 6f4545ccd..38cd51bee 100644 --- a/ansible/roles/ironic-inspector-rules/tasks/main.yml +++ b/ansible/roles/ironic-inspector-rules/tasks/main.yml @@ -1,25 +1,4 @@ --- -- name: Ensure required packages are installed - yum: - name: "{{ item }}" - state: installed - become: True - with_items: - - gcc - - libffi-devel - - openssl-devel - - python-devel - - python-pip - - python-virtualenv - -- name: Ensure the latest version of pip is installed - pip: - name: "{{ item.name }}" - state: latest - virtualenv: "{{ ironic_inspector_venv }}" - with_items: - - { name: pip } - - name: Ensure required Python packages are installed pip: name: "{{ item.name }}" @@ -28,7 +7,6 @@ virtualenv: "{{ ironic_inspector_venv }}" with_items: - name: python-ironic-inspector-client - - name: shade - name: Set a fact to ensure Ansible uses the python interpreter in the virtualenv set_fact: diff --git a/ansible/roles/shade/defaults/main.yml b/ansible/roles/shade/defaults/main.yml new file mode 100644 index 000000000..612ccf520 --- /dev/null +++ b/ansible/roles/shade/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# Path to a directory in which to create a virtualenv. +shade_venv: diff --git a/ansible/roles/shade/tasks/main.yml b/ansible/roles/shade/tasks/main.yml new file mode 100644 index 000000000..2a3991fbb --- /dev/null +++ b/ansible/roles/shade/tasks/main.yml @@ -0,0 +1,30 @@ +--- +- name: Ensure required packages are installed + yum: + name: "{{ item }}" + state: installed + become: True + with_items: + - gcc + - libffi-devel + - openssl-devel + - python-devel + - python-pip + - python-virtualenv + +- name: Ensure the latest version of pip is installed + pip: + name: "{{ item.name }}" + state: latest + virtualenv: "{{ shade_venv }}" + with_items: + - { name: pip } + +- name: Ensure required Python packages are installed + pip: + name: "{{ item.name }}" + version: "{{ item.version | default(omit) }}" + state: present + virtualenv: "{{ shade_venv }}" + with_items: + - name: shade