nog een update

This commit is contained in:
2025-01-05 20:12:01 +01:00
parent 82869dcb32
commit 77f9b802e9
10 changed files with 143 additions and 78 deletions
+19 -31
View File
@@ -1,3 +1,10 @@
- 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
@@ -5,26 +12,14 @@
- name: Set hostname
hostname:
name: "{{ inventory_hostname }}"
- name: Print distribution
ansible.builtin.debug:
#var: ansible_facts ansible_distribution_release
var: ansible_distribution_release
# - name: Print distribution
# ansible.builtin.debug:
# var: ansible_distribution_release
- name: Add aurbis group
ansible.builtin.group:
name: aurbis
state: present
- name: Create users
ansible.builtin.user:
name: "{{ item }}"
groups:
- aurbis
- sudo
- wheel
append: true
shell: /bin/bash
state: present
when: users is defined
loop: "{{ users }}"
- import_tasks: tasks/create_users.yml
- name: Add IP address of relevant hosts to /etc/hosts
lineinfile:
dest: /etc/hosts
@@ -58,18 +53,11 @@
hosts: all
become: true
tasks:
- name: Git clone
ansible.builtin.git:
repo: https://git.hoekveen.net/mark/scripts.git
dest: /opt/scripts
force: true
- name: Set permissions and ownership for scripts folder
file:
path: /opt/scripts
state: directory
recurse: true
group: aurbis
mode: "0775"
- name: Add scripts directory to safe.directory
ansible.builtin.command:
cmd: git config --system --add safe.directory /opt/scripts
- 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