69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
- name: Preprovisioning
|
|
hosts: all
|
|
become: true
|
|
tasks:
|
|
- import_tasks: tasks/preprovision.yml
|
|
handlers:
|
|
- import_tasks: handlers/main.yml
|
|
- name: Provision all hosts
|
|
hosts: all
|
|
become: true
|
|
tasks:
|
|
- name: Set hostname
|
|
hostname:
|
|
name: "{{ inventory_hostname }}"
|
|
# - name: Print distribution
|
|
# ansible.builtin.debug:
|
|
# var: ansible_distribution_release
|
|
- name: Add aurbis group
|
|
ansible.builtin.group:
|
|
name: aurbis
|
|
state: present
|
|
- import_tasks: tasks/create_users.yml
|
|
- name: Add IP address of relevant hosts to /etc/hosts
|
|
lineinfile:
|
|
dest: /etc/hosts
|
|
regexp: ".*{{ item }}$"
|
|
line: "{{ hostvars[item].ansible_host }} {{item}}"
|
|
state: present
|
|
when:
|
|
- hostvars[item].ansible_host is defined
|
|
- (inventory_hostname in groups['home'] and (item in groups['home'] or item in groups['cloud'])) or
|
|
(inventory_hostname not in groups['home'] and item in groups['cloud'])
|
|
with_items: "{{ groups.all }}"
|
|
- name: Update Debian hosts
|
|
hosts: debian
|
|
become: true
|
|
tasks:
|
|
- name: Update
|
|
include_tasks: tasks/update_debian.yml
|
|
- name: Update Arch hosts
|
|
hosts: arch
|
|
become: true
|
|
tasks:
|
|
- name: Update
|
|
include_tasks: tasks/update_arch.yml
|
|
- name: Docker
|
|
hosts: debian
|
|
become: true
|
|
tasks:
|
|
- name: Update
|
|
include_tasks: tasks/install_docker_debian.yml
|
|
- name: Add utility scripts
|
|
hosts: all
|
|
become: true
|
|
tasks:
|
|
- import_tasks: tasks/scripts.yml
|
|
- name: Add Nocturnal SMB share
|
|
hosts: home
|
|
vars_files:
|
|
- vault/nocturnal.yml
|
|
become: true
|
|
tasks:
|
|
- import_tasks: tasks/nocturnal_smb.yml
|
|
- name: Install tmux
|
|
hosts: all
|
|
become: true
|
|
tasks:
|
|
- import_tasks: tasks/tmux.yml
|