Browse Source

subtasks.

master teil9
Olli Graf 8 months ago
parent
commit
e71dc87368
  1. 2
      ansible.cfg
  2. 11
      inventory.yml
  3. 7
      log2ram-st.yml
  4. 7
      roles/gather-facts/tasks/main.yml
  5. 7
      roles/log2ram-st/tasks/add_repo_key.yml
  6. 9
      roles/log2ram-st/tasks/add_repo_source.yml
  7. 8
      roles/log2ram-st/tasks/install_log2ram.yml
  8. 5
      roles/log2ram-st/tasks/main.yml
  9. 7
      roles/log2ram-st/tasks/main.yml.bak
  10. 10
      roles/log2ram/tasks/main.yml
  11. 5
      roles/subtasks/reboot.yml
  12. 7
      roles/subtasks/upgrade.yml

2
ansible.cfg

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

11
inventory.yml

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

7
log2ram-st.yml

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

7
roles/gather-facts/tasks/main.yml

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

7
roles/log2ram-st/tasks/add_repo_key.yml

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

9
roles/log2ram-st/tasks/add_repo_source.yml

@ -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

8
roles/log2ram-st/tasks/install_log2ram.yml

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

5
roles/log2ram-st/tasks/main.yml

@ -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

7
roles/log2ram-st/tasks/main.yml.bak

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

10
roles/log2ram/tasks/main.yml

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

5
roles/subtasks/reboot.yml

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

7
roles/subtasks/upgrade.yml

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