-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
61 lines (53 loc) · 1.54 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
- hosts: all
tags: always
gather_facts: true
# Pick your host. This should be a metal machine (or the most metal you have access to)
- hosts: metal
become: true
tags: base-all
environment:
DOWNLOAD_KEYSERVER: "hkp://keyserver.ubuntu.com"
roles:
# Prep it for basic usage
- role: base
tags: ["base"]
# Install containers
- role: lxc
tags: ["lxc"]
when: lxc_containers is defined
# - hosts: metal
# become: true
# tags: containers
# tasks:
# - name: Collect container info
# community.general.lxc_container:
# name: "{{ item.key }}"
# register: container_info
# with_dict: "{{ lxc_containers }}"
# - name: Print container info
# debug:
# msg: "{{ lxc_containers }}"
# - name: Add ansible hosts for all found containers
# ansible.builtin.add_host:
# name: "{{ item.item.key }}"
# hostname: "{{ item.lxc_container.ips[0] }}"
# groups: "{{ item.item.value.groups }}"
# loop: "{{ container_info.results }}"
# - name: show all the hosts matching the pattern, i.e. all in the group container
# debug:
# msg: "{{ hostvars }}"
# - hosts: all
# gather_facts: true
# tasks:
# - name: show all the hosts matching the pattern, i.e. all in the group container
# debug:
# msg: "{{ hostvars.simple_web }}"
# - name: Refresh inventory to ensure new instances exist in inventory
# meta: refresh_inventory
# - hosts: container
# user: root
# roles:
# - users
# - base
# tags: base