commit 996d8ead7ef45502b95e293594ced1f86c7d061e Author: rcordier Date: Fri May 10 12:46:48 2024 -0400 add: first files diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..2b01c2c --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,19 @@ +version: 3 + +tasks: + + install_deps: + desc: Install galaxy requirements + cmds: + - ansible-galaxy install -r requirements.yml + + run: + desc: Run site playbook + cmds: + - ansible-playbook playbooks/hello.yml + + inventory: + desc: show inventyory + aliases: [inv] + cmds: + - ansible-inventory --graph diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..c3c1f59 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,7 @@ + + + +[defaults] +collections_path = ansible_collections/ + +inventory = inventories \ No newline at end of file diff --git a/inventories/lab/hosts.yml b/inventories/lab/hosts.yml new file mode 100644 index 0000000..9ceae84 --- /dev/null +++ b/inventories/lab/hosts.yml @@ -0,0 +1,22 @@ +lab: + vars: + ansible_host: localhost + ansible_connection: local + + hosts: + local: + + children: + web: + hosts: + client1-web1: + #ansible_port: 2222 + client1-web2: + vars: + ansible_user: root + db: + hosts: + client1-db: + #vars: + # ansible_become: true + # ansible_become_pass: password diff --git a/playbooks/hello.yml b/playbooks/hello.yml new file mode 100644 index 0000000..2de859a --- /dev/null +++ b/playbooks/hello.yml @@ -0,0 +1,38 @@ + + +- name: Hello World + hosts: local + gather_facts: no + + pre_tasks: + - name: Print debug message + debug: + msg: Hello, world! + +- name: Hello World + hosts: client1-web1 + gather_facts: no + + tasks: + - name: test1 + import_role: + name: activia.infra_common.configure_web + +- name: Hello World + hosts: client1-db + gather_facts: no + + tasks: + - name: test2 + import_role: + name: activia.infra_common.configure_db + + # option: 1 + + # roles: + # - role: roles/configure-web + # # - role: roles/configure-db + + + + \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..2a71bea --- /dev/null +++ b/requirements.yml @@ -0,0 +1,5 @@ +collections: + - name: https://git.jeznet.org/activia-tests/ansible-collection-infra-common.git + type: git + version: main + \ No newline at end of file