diff --git a/install_openitcockpit.yaml b/install_openitcockpit.yaml index 27618ab..a30a957 100644 --- a/install_openitcockpit.yaml +++ b/install_openitcockpit.yaml @@ -1,35 +1,45 @@ --- -- hosts: cockpithosts +- hosts: debianhosts gather_facts: no tasks: # Copy remote file (host.example.com:/tmp/somefile) into # /tmp/fetched/host.example.com/tmp/somefile on local machine - - ansible.builtin.copy: - src: ./files/openitcockpit-agent_3.1.1_amd64.deb - dest: /tmp/openitcockpit-agent_3.1.1_amd64.deb - owner: root - group: root - mode: '0644' + + # - ansible.builtin.copy: + # src: ./files/openitcockpit-agent_3.1.1_amd64.deb + # dest: /tmp/openitcockpit-agent_3.1.1_amd64.deb + # owner: root + # group: root + # mode: '0644' - - name: change working directory - ansible.builtin.shell: - cmd: ls -l - chdir: /tmp + # - name: change working directory + # ansible.builtin.shell: + # cmd: ls -l + # chdir: /tmp - - name: Install openitcockpit agent - ansible.builtin.shell: - cmd: dpkg -i /tmp/openitcockpit-agent_3.1.1_amd64.deb + # - name: Install openitcockpit agent + # ansible.builtin.shell: + # cmd: dpkg -i /tmp/openitcockpit-agent_3.1.1_amd64.deb - - ansible.builtin.copy: - src: ./files/config.ini - dest: /etc/openitcockpit-agent/config.ini - owner: root - group: root - mode: '0644' + # - ansible.builtin.copy: + # src: ./files/config.ini + # dest: /etc/openitcockpit-agent/config.ini + # owner: root + # group: root + # mode: '0644' - - name: Restart openitcockpit agent - ansible.builtin.shell: - cmd: systemctl restart openitcockpit-agent + # - name: Restart openitcockpit agent + # ansible.builtin.shell: + # cmd: systemctl restart openitcockpit-agent + + - name: Remove a package + hosts: all + become: yes # Run tasks with sudo privileges + tasks: + - name: Remove the 'opencockpit' package + ansible.builtin.apt: + name: openitcockpit-agent + state: absent # - name: Install a list of packages # ansible.builtin.apt: diff --git a/linux_updates.yaml b/linux_updates.yaml index 592438e..ee85b9d 100644 --- a/linux_updates.yaml +++ b/linux_updates.yaml @@ -23,31 +23,22 @@ - hosts: debianhosts gather_facts: no tasks: - # - name: Update all installed packages using APT module - # apt: - # name: '*' - # state: latest - # update_cache: yes - # only_upgrade: yes - # register: apt_update_status + - name: Update all installed packages using APT module + apt: + name: '*' + state: latest + update_cache: yes + only_upgrade: yes + register: apt_update_status - # - name: Remove packages not needed anymore - # apt: - # autoremove: yes + - name: Remove packages not needed anymore + apt: + autoremove: yes - # - name: Reboot when packages were updated - # reboot: - # post_reboot_delay: 60 - # when: apt_update_status.changed - - - name: Remove a package - hosts: all - become: yes # Run tasks with sudo privileges - tasks: - - name: Remove the 'opencockpit' package - ansible.builtin.apt: - name: openitcockpit-agent - state: absent + - name: Reboot when packages were updated + reboot: + post_reboot_delay: 60 + when: apt_update_status.changed #- hosts: apkhosts # tasks: