mirror of
https://git.bibube.com/nguyen/raspi.git
synced 2024-11-22 22:42:14 +00:00
Add Inventory
This commit is contained in:
11
playbooks/inventory.ini
Normal file
11
playbooks/inventory.ini
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[master]
|
||||||
|
home-k8s1 ansible_host=192.168.0.201 ansible_user=pi ansible_ssh_private_key_file=~/.ssh/id_rsa
|
||||||
|
|
||||||
|
[workers]
|
||||||
|
home-k8s2 ansible_host=192.168.0.202 ansible_user=pi ansible_ssh_private_key_file=~/.ssh/id_rsa
|
||||||
|
home-k8s3 ansible_host=192.168.0.203 ansible_user=pi ansible_ssh_private_key_file=~/.ssh/id_rsa
|
||||||
|
home-k8s4 ansible_host=192.168.0.204 ansible_user=pi ansible_ssh_private_key_file=~/.ssh/id_rsa
|
||||||
|
home-k8s0 ansible_host=192.168.0.205 ansible_user=pi ansible_ssh_private_key_file=~/.ssh/id_rsa
|
||||||
|
|
||||||
|
[all:vars]
|
||||||
|
ansible_python_interpreter=/usr/bin/python3
|
||||||
27
playbooks/update_upgrade_os.yml
Normal file
27
playbooks/update_upgrade_os.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- name: Update and upgrade Raspberry Pi
|
||||||
|
hosts: all
|
||||||
|
become: yes
|
||||||
|
tasks:
|
||||||
|
- name: Update the APT package index
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Upgrade all installed packages
|
||||||
|
apt:
|
||||||
|
upgrade: dist
|
||||||
|
autoremove: yes
|
||||||
|
autoclean: yes
|
||||||
|
cache_valid_time: 3600 # Cache validity time in seconds
|
||||||
|
|
||||||
|
#- name: Ensure that Raspberry Pi firmware is up to date
|
||||||
|
# shell: sudo rpi-update
|
||||||
|
# args:
|
||||||
|
# creates: /boot/.firmware_up_to_date
|
||||||
|
|
||||||
|
- name: Reboot if needed
|
||||||
|
reboot:
|
||||||
|
msg: "Rebooting the Raspberry Pi after update"
|
||||||
|
reboot_timeout: 600
|
||||||
|
test_command: uptime
|
||||||
|
|
||||||
Reference in New Issue
Block a user