46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
|
---
|
||
|
- hosts: all
|
||
|
gather_facts: no
|
||
|
|
||
|
pre_tasks:
|
||
|
- name: Wait for host to come up
|
||
|
tags: always
|
||
|
block:
|
||
|
- name: Wait for SSH connection
|
||
|
wait_for:
|
||
|
state: started
|
||
|
port: 22
|
||
|
host: "192.168.30.7"
|
||
|
timeout: 300
|
||
|
connect_timeout: 300
|
||
|
search_regex: OpenSSH
|
||
|
delegate_to: localhost
|
||
|
- name: Wait for cloud-init to finish
|
||
|
command:
|
||
|
cmd: cloud-init status --wait
|
||
|
register: cloudinit
|
||
|
changed_when: "'..' in cloudinit.stdout"
|
||
|
- name: Gather facts
|
||
|
setup:
|
||
|
- name: Copy resolv.conf
|
||
|
copy:
|
||
|
src: resolv.conf
|
||
|
dest: /etc/resolv.conf
|
||
|
- name: Update repositories
|
||
|
apt:
|
||
|
autoremove: true
|
||
|
upgrade: yes
|
||
|
state: latest
|
||
|
update_cache: yes
|
||
|
cache_valid_time: 86400 # One day
|
||
|
- name: Install packages
|
||
|
apt:
|
||
|
pkg:
|
||
|
- qemu-guest-agent
|
||
|
- dnsutils
|
||
|
|
||
|
roles:
|
||
|
- {role: 'dnsmasq', tags: 'dnsmasq'}
|
||
|
- {role: 'nsd', tags: 'nsd'}
|
||
|
- {role: 'ca', tags: 'ca'}
|