123456789101112131415161718192021222324252627282930313233343536 |
- ---
- # name: update.yaml
- - hosts: [apu,desktops]
- tasks:
- - name: Testausgabe
- debug: msg="Hallo von {{ ansible_hostname }} Ansible managed!"
- - name: df -h Aufruf
- command: df -h /
- changed_when: false
- register: df_cmd
- - debug:
- msg: '{{df_cmd.stdout_lines}} {{ansible_distribution }}'
- - name: Ping my hosts
- ansible.builtin.ping:
- changed_when: false
- - name: apt update mit upgrade und autoremove
- ansible.builtin.apt:
- update_cache: yes
- cache_valid_time: 3600
- autoremove: yes
- upgrade: yes
- when: ansible_os_family == "Debian"
- # - stat:
- # path: /var/run/needrestart
- # register: needrestart_file
- # - name: reboot falls erforderlich
- # ansible.builtin.reboot:
- # when:
- # - needrestart_file.stat.exists == True
|