-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.yml
More file actions
32 lines (29 loc) · 966 Bytes
/
deploy.yml
File metadata and controls
32 lines (29 loc) · 966 Bytes
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
---
# For bootstrapping, often the username and password are different than are
# used after initial provisioning. That means we need to override those
# settings on the command line. The SSH port may also be changed during
# execution, so that too can be specified, like:
# ansible-playbook -vv playbook.yml --ask-pass -e ansible_become_password="Test123$" -e ansible_ssh_port=22 -e ansible_user=root --limit myhostname.com
- hosts: all
become: no
gather_facts: False
tasks:
- name: make sure --limit was passed to ansible
fail:
msg: "you must use -l or --limit"
when: ansible_limit is not defined
run_once: true
delegate_to: localhost
- hosts: all
module_defaults:
ansible.builtin.setup:
gather_subset: all
gather_timeout: 10
become: yes
tasks:
- name: Run roles for hosts
include_role:
name: "{{ _loop_role }}"
with_items: "{{ host_roles }}"
loop_control:
loop_var: "_loop_role"