Skip to content

Commit 0b2d5bc

Browse files
authored
Merge pull request #6 from azimuth-cloud/feat/pip-deps
Support adding pip packages
2 parents 723ec49 + ddfe4f1 commit 0b2d5bc

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

roles/linux_ansible_init/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The ansible-init system consists of a script that is installed in the image and
66

77
ansible-init is able to execute playbooks that are baked into the images, and also from arbitrary Ansible collections, e.g. from Galaxy or from a Git repository. These extra playbooks are specified by the Azimuth operator in their Azimuth configuration, and communicated to the instances that make up platforms using cloud-init instance metadata. This allows site- or platform-specific customisations to be applied to instances in a consistent way without modifying the images.
88

9+
## Role variables
10+
11+
- `ansible_init_pip_packages`: Optional. List of packages to install into venv.
12+
913
## Usage
1014

1115
The 255 byte limit per key/value pair for instance metadata means that collections will be defined by metadata items of the following structure:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ansible_init_pip_packages:
2+
- ansible
3+
- jmespath
4+
- requests

roles/linux_ansible_init/tasks/main.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717

1818
- name: Install dependencies into virtualenv
1919
pip:
20-
name:
21-
- ansible
22-
- jmespath
23-
- requests
20+
name: "{{ ansible_init_pip_packages }}"
2421
state: latest
2522
virtualenv: /usr/lib/ansible-init
2623
virtualenv_command: "{{ python3_cmds[ansible_facts['distribution']] }} -m venv --upgrade-deps"

0 commit comments

Comments
 (0)