Merge "Create ansible-galaxy-import role"
This commit is contained in:
commit
8b2fe277e2
28
roles/ansible-galaxy-import/README.rst
Normal file
28
roles/ansible-galaxy-import/README.rst
Normal file
@ -0,0 +1,28 @@
|
||||
Import ansible roles into ansible galaxy
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: ansible_galaxy_branch
|
||||
:default: zuul.branch
|
||||
|
||||
The name of a branch to import.
|
||||
|
||||
.. zuul:rolevar:: ansible_galaxy_executable
|
||||
:default: ansible-galaxy
|
||||
|
||||
Path to ansible-galaxy executable.
|
||||
|
||||
.. zuul:rolevar:: ansible_galaxy_info
|
||||
|
||||
Complex argument which contains the information about the Ansible
|
||||
Galaxy server as well as the authentication information needed. It
|
||||
is expected that this argument comes from a `Secret`.
|
||||
|
||||
.. zuul:rolevar:: server
|
||||
:default: https://galaxy.ansible.com
|
||||
|
||||
The API server destination.
|
||||
|
||||
.. zuul:rolevar:: token
|
||||
|
||||
Identify with github token rather than username and password.
|
4
roles/ansible-galaxy-import/defaults/main.yaml
Normal file
4
roles/ansible-galaxy-import/defaults/main.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
ansible_galaxy_branch: "{{ zuul.branch }}"
|
||||
ansible_galaxy_executable: ansible-galaxy
|
||||
ansible_galaxy_server: "{{ ansible_galaxy_info.server|default('https://galaxy.ansible.com') }}"
|
6
roles/ansible-galaxy-import/tasks/main.yaml
Normal file
6
roles/ansible-galaxy-import/tasks/main.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
- name: Login into Ansible Galaxy
|
||||
command: "{{ ansible_galaxy_executable }} -s {{ ansible_galaxy_server }} login --github-token {{ galaxy_info.token }}"
|
||||
no_log: True
|
||||
|
||||
- name: Import role into Ansible Galaxy
|
||||
command: "{{ ansible_galaxy_executable }} -s {{ ansible_galaxy_server }} import --branch {{ ansible_galaxy_branch }} {{ zuul.project['name'].split('/')[0] }} {{ zuul.project['short_name'] }}"
|
Loading…
Reference in New Issue
Block a user