-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
45 lines (42 loc) · 1.1 KB
/
playbook.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
44
45
---
- hosts: all
tasks:
- name: Set ansible_end_user if undefined
block:
- name: Get default end user
ansible.builtin.command: "id -u -n 1000"
register: end_user
changed_when: false
- name: Set ansible_end_user variable
ansible.builtin.set_fact:
ansible_end_user: "{{ end_user.stdout }}"
rescue:
- name: Print message
ansible.builtin.debug:
msg: 'ansible_end_user variable is undefined'
when: ansible_end_user is undefined
- hosts: all
roles:
- ecgalaxy.bootstrap
- ecgalaxy.common_packages
- ecgalaxy.aws_cli
- ecgalaxy.ca_certificates
- ecgalaxy.containers_toolbox
- ecgalaxy.java_openjdk
- ecgalaxy.maven
- ecgalaxy.nodejs
- ecgalaxy.oracle_instantclient
- ecgalaxy.php
- ecgalaxy.task
- ecgalaxy.terraform
- hosts: all
roles:
- role: ecgalaxy.docker
when: ansible_end_user is undefined
- hosts: all
roles:
- role: ecgalaxy.docker
when: ansible_end_user is defined
vars:
docker_users:
- "{{ ansible_end_user }}"