101 lines
2.3 KiB
YAML
101 lines
2.3 KiB
YAML
---
|
|
- name: "Populate service facts"
|
|
service_facts:
|
|
|
|
- name: "Set timezone"
|
|
timezone:
|
|
name: Europe/Paris
|
|
|
|
- name: Set a hostname
|
|
ansible.builtin.hostname:
|
|
name: "{{ inventory_hostname }}"
|
|
|
|
- name: "Install packages"
|
|
apt:
|
|
pkg: "{{ vars[inventory_hostname]['general']['host_packages'] }}"
|
|
update_cache: yes
|
|
state: latest
|
|
|
|
- name: "Remove packages"
|
|
apt:
|
|
pkg: "{{ vars[inventory_hostname]['general']['host_removed_packages'] }}"
|
|
update_cache: yes
|
|
state: absent
|
|
|
|
- name: "Add keyrings directory"
|
|
file:
|
|
path: /etc/apt/keyrings
|
|
state: directory
|
|
mode: "755"
|
|
|
|
- name: "Add vector signed repositories"
|
|
ansible.builtin.get_url:
|
|
url: https://repositories.timber.io/public/vector/gpg.3543DB2D0A2BC4B8.key
|
|
dest: /etc/apt/keyrings/vector.asc
|
|
|
|
- name: "Add vector repository"
|
|
ansible.builtin.apt_repository:
|
|
repo: "deb [signed-by=/etc/apt/keyrings/vector.asc] https://repositories.timber.io/public/vector/deb/debian {{ ansible_distribution_release }} main"
|
|
state: present
|
|
|
|
- name: "Install vector"
|
|
ansible.builtin.apt:
|
|
name: vector
|
|
update_cache: yes
|
|
state: present
|
|
|
|
- name: "Host is modified"
|
|
include_tasks: host_modified.yml
|
|
when: build_host.host_changed
|
|
|
|
- name: "Copy machines scripts"
|
|
ansible.builtin.copy:
|
|
src: "{{ item }}"
|
|
dest: "/usr/local/sbin"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0755"
|
|
loop: "{{ lookup('fileglob', 'sbin/*', wantlist=True) | list }}"
|
|
|
|
- name: "Remove dest images files"
|
|
file:
|
|
path: /var/lib/risotto/images_files
|
|
state: "{{ item }}"
|
|
mode: "0700"
|
|
with_items:
|
|
- absent
|
|
- directory
|
|
|
|
- name: "Copy images files"
|
|
unarchive:
|
|
remote_src: true
|
|
src: "/tmp/new_configurations/images_files.tar"
|
|
dest: "/var/lib/risotto/images_files"
|
|
|
|
- name: "Create versions directory"
|
|
file:
|
|
path: /var/lib/risotto/machines_informations
|
|
state: directory
|
|
mode: "0700"
|
|
|
|
- name: "Empty tests files"
|
|
file:
|
|
path: /var/lib/risotto/tests
|
|
state: "{{ item }}"
|
|
mode: "0700"
|
|
with_items:
|
|
- absent
|
|
- directory
|
|
|
|
- name: "Copy tests files"
|
|
unarchive:
|
|
remote_src: true
|
|
src: "/tmp/new_configurations/tests.tar"
|
|
dest: "/var/lib/risotto/tests"
|
|
when: copy_tests
|
|
|
|
- name: "Create TLS directory"
|
|
file:
|
|
path: /var/lib/risotto/tls
|
|
state: directory
|
|
mode: "755"
|