fix: Initial ansible setup

This commit is contained in:
lif
2025-10-12 08:21:43 +01:00
parent 069ac709e1
commit 78ed25a25a
15 changed files with 124 additions and 1572 deletions

2
ansible/ansible.cfg Normal file
View File

@@ -0,0 +1,2 @@
[defaults]
host_key_checking=False

34
ansible/master.yml Normal file
View File

@@ -0,0 +1,34 @@
---
- hosts: all
become: true
tasks:
# write hello world to a file in the home directory
- name: write hello
copy:
content: "hello ansible from ansible-manager!"
dest: /home/vagrant/hello2.txt
mode: 0644
become: true
- name: Echo hello
shell: echo 'hello ansible!'
args:
chdir: $HOME
# Echo the contents of the hello.txt file
- name: Echo hello
shell: cat /home/vagrant/hello.txt
args:
chdir: $HOME
# Echo the contents of the hello2.txt file
- name: Echo hello2
shell: cat /home/vagrant/hello2.txt
args:
chdir: $HOME
# - name: Initialize the cluster
# shell: docker swarm init --advertise-addr 192.168.56.10 >> cluster_initialized.txt
# args:
# chdir: $HOME
# creates: cluster_initialized.txt