diff --git a/inventory.ini b/inventory.ini new file mode 100644 index 0000000..26d5552 --- /dev/null +++ b/inventory.ini @@ -0,0 +1,2 @@ +[pis] +pi_node1 ansible_host={{IP}} ansible_user={{USER}} ansible_ssh_private_key_file=~/.ssh/id_rsa diff --git a/playbook.yml b/playbook.yml index 26d5552..b3b8f51 100644 --- a/playbook.yml +++ b/playbook.yml @@ -1,2 +1,8 @@ -[pis] -pi_node1 ansible_host={{IP}} ansible_user={{USER}} ansible_ssh_private_key_file=~/.ssh/id_rsa +- name: Provision Raspberry Pi with Docker, K3s, and Prometheus + hosts: pis + become: yes + + roles: + - docker + - k3s + - prometheus diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d1e0b47 --- /dev/null +++ b/setup.py @@ -0,0 +1,17 @@ + +if __name__ == '__main__': + print('Running setup config for PIs') + + ip = input('Enter the IP of the PI:') + user = input('Enter the user of the PI:') + + with open('inventory.ini', 'r') as inventory: + content = inventory.read() + content = content.replace('{{USER}}', user) + content = content.replace('{{IP}}', ip) + + with open('inventory.ini', 'w') as inventory: + inventory.write(content) + + print(f'Changed inventory.ini content with: {content}') +