subtasks.

This commit is contained in:
2024-03-17 13:37:54 +01:00
parent 91fb8962a4
commit e71dc87368
12 changed files with 79 additions and 6 deletions

View File

@@ -1,11 +1,13 @@
[defaults]
inventory = inventory.yml
library = ./library
interpreter_python = auto_silent
nocows = 1
timeout= 60
force_valid_group_names = ignore
#private_key_file = ~/.ssh/id_ed25519
private_key_file = ~/.ssh/id_rsa
default_module_path = ./library
[ssh_connection]
ssh_args = -o StrictHostKeyChecking=no

View File

@@ -4,11 +4,20 @@ stack4:
willie:
kirk:
brandine:
test:
hosts:
hans:
cleatus:
terry:
webs:
hosts:
web[00:09]:
frinks:
hosts:
frink[00:05]
vars:
ansible_python_interpreter: /usr/bin/python3
ansible_python_interpreter: /usr/bin/python

7
log2ram-st.yml Normal file
View File

@@ -0,0 +1,7 @@
---
- hosts: "{{ target }}"
gather_facts: false
remote_user: pi
roles:
- log2ram-st

View File

@@ -1,3 +1,10 @@
- name: Informationen sammeln
ansible.builtin.debug:
var: ansible_facts
- name: leeres File anlegen
file:
path: /home/pi/testwhen
state: touch
when: (ansible_facts['hostname'] == 'brandine' or ansible_facts['hostname'] == 'kirk')

View File

@@ -0,0 +1,7 @@
---
- name: Key
become: true
apt_key:
url: https://azlux.fr/repo.gpg.key
state: present

View File

@@ -0,0 +1,9 @@
---
- name: Paketquelle
become: true
apt_repository:
repo: 'deb http://packages.azlux.fr/debian/ bookworm main'
state: present
filename: log2ram
update_cache: yes

View File

@@ -0,0 +1,8 @@
---
- name: log2ram installieren
become: true
apt:
update_cache: yes
name:
- log2ram

View File

@@ -0,0 +1,5 @@
- include: ../subtasks/upgrade.yml
- include: add_repo_key.yml
- include: add_repo_source.yml
- include: install_log2ram.yml
- include: ../subtasks/reboot.yml

View File

@@ -0,0 +1,7 @@
- name: logram Haupttask
tasks:
- include: add_repo_key.yml
- include: add_repo_source.yml
- include: install_log2ram.yml

View File

@@ -1,8 +1,8 @@
#- name: PI Update
# become: true
# apt:
# update_cache: yes
# upgrade: dist
- name: PI Update
become: true
apt:
update_cache: yes
upgrade: dist
- name: Key
become: true
apt_key:

View File

@@ -0,0 +1,5 @@
---
- name: Neustart
become: true
reboot:

View File

@@ -0,0 +1,7 @@
---
- name: PI Update
become: true
apt:
update_cache: yes
upgrade: dist