diff --git a/ansible-5/inventory.ini b/ansible-5/inventory.ini index 79f2b21..11035ee 100644 --- a/ansible-5/inventory.ini +++ b/ansible-5/inventory.ini @@ -4,6 +4,7 @@ localhost ansible_connection=local home ansible_ssh_host=192.168.4.11 cubox-i ansible_ssh_host=192.168.4.12 cubox-m ansible_ssh_host=192.168.4.15 +raspberrypi_tv ansible_ssh_host=192.168.4.43 [ns] ;home ansible_ssh_host=192.168.4.11 diff --git a/ansible-5/playbooks/bootstrap.yaml b/ansible-5/playbooks/bootstrap.yaml index 62d7f1f..2978e07 100644 --- a/ansible-5/playbooks/bootstrap.yaml +++ b/ansible-5/playbooks/bootstrap.yaml @@ -16,10 +16,12 @@ file: path=~/.ssh state=directory mode=700 - debug: var=ansible_os_family - run_once: true - debug: var=ansible_architecture - run_once: true + + - debug: var=ansible_distribution_release + + - debug: var=ansible_pkg_mgr tasks: - name: ping diff --git a/ansible-5/playbooks/update_managed.yaml b/ansible-5/playbooks/update_managed.yaml new file mode 100644 index 0000000..1068c3b --- /dev/null +++ b/ansible-5/playbooks/update_managed.yaml @@ -0,0 +1,29 @@ +--- +# update the managed host machines + +- name: updates + hosts: managed + gather_facts: true + + vars: + + pre_tasks: + + roles: + + tasks: + - name: print os version + ansible.builtin.debug: + var: ansible_facts["os_family"] + +## ansible_pkg_mgr, ansible_os_family, ansible_distribution + - name: update packages + apt: + name: "*" + state: latest + update_cache: yes + cache_valid_time: 3600 + when: ansible_pkg_mgr == "apt" + become: true + +## TODO: raspberrypi os should be a full-upgrade