-
Notifications
You must be signed in to change notification settings - Fork 5
/
registry_setup.yml
43 lines (28 loc) · 951 Bytes
/
registry_setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
- name: Setup registry
hosts: localhost
become: yes
gather_facts: yes
vars:
registry_server: "{{ansible_fqdn}}:5000"
vars_files:
- vault.yml
tasks:
- name: Setup registry
include_role:
name: registry
vars:
pip_extra_args:
- name: b64encode registry authentication string
set_fact:
password_string: "{{registry_username + ':' + registry_password }}"
- name: Create authentication json string
set_fact:
auth_file_content:
auths: '{ "{{ registry_server }}": {"auth": "{{ password_string | b64encode }}"} }'
- name: "Save credentials to {{podman_auth_file}}"
copy:
content: "{{auth_file_content | to_nice_json}}"
dest: "{{podman_auth_file}}"
- name: Podman login to registry
command: podman login --authfile {{podman_auth_file}} {{registry_server}}