forked from lukeharvey/ansible-initial-server-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.yml
33 lines (28 loc) · 1.27 KB
/
bootstrap.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
---
# USAGE for a brand new machine:
#
# ansible-playbook bootstrap.yml -u root -k --extra-vars "target=dirac-new" --ask-vault-pass
#FIXME: on really brand new machines, perhaps sudo isn't installed, and there are accidentally some tasks in bootstrap that still ask for become: true, so perhaps we fix that by removing those erronous becomes (might not work because pve_server is shared between both), or by setting --become_method=su above
#
# Just to renew ssh hostkeys etc, without having to first turn on ssh PermitRootLogin:
#
# ansible-playbook bootstrap.yml -u ansible --extra-vars "target=dirac-new" --ask-vault-pass --become
# Fix up an old installation:
# ansible-playbook bootstrap.yml -u tconnors -k --extra-vars "target=maxwell" --ask-vault-pass --become --become-method=su -K
# Fix up an lxc container:
# ansible-playbook bootstrap.yml -u root --diff --extra-vars "target=zm"
#
# https://stackoverflow.com/questions/18195142/safely-limiting-ansible-playbooks-to-a-single-machine
- hosts: "{{ target | default('all,!openwrt,!tasmota') }}"
vars_files:
- vars/main.yml
vars:
- in_bootstrap: true
roles:
- common_handlers
- install_files
- bootstrap
- role: pve_server
when: host_is_pve_server | default(false)
- ssh_bootstrap
- user