From 2e03f3fc8aa621af258d0f0c2d1c435ce2bc8786 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 10 Jun 2022 20:43:10 +0000 Subject: [PATCH] ansible base config --- ansible.cfg | 5 +++++ inventory | 22 ++++++++++++++++++++++ portainer.yml | 25 +++++++++++++++++++++++++ post_installtion.yaml | 29 +++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 ansible.cfg create mode 100644 inventory create mode 100644 portainer.yml create mode 100644 post_installtion.yaml diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..70c1b21 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,5 @@ +[defaults] + +inventory=inventory +host_key_checking=False + diff --git a/inventory b/inventory new file mode 100644 index 0000000..140f23e --- /dev/null +++ b/inventory @@ -0,0 +1,22 @@ +[master] +10.40.1.30 + +[nodes] +10.40.1.31 +10.40.1.32 + +[test] +10.40.1.25 + +[test:vars] +ansible_ssh_user=root +ansible_ssh_pass=1234 + +[master:vars] +ansible_ssh_user=root +ansible_ssh_pass=12345 + +[nodes:vars] +ansible_ssh_user=root +ansible_ssh_pass=12345 + diff --git a/portainer.yml b/portainer.yml new file mode 100644 index 0000000..e6d469d --- /dev/null +++ b/portainer.yml @@ -0,0 +1,25 @@ +--- +- name: git + hosts: test + become: yes + tasks: + - name: Add a setting to ~/.gitconfig + community.general.git_config: + name: http.sslverify + scope: global + value: false + + - name: portainer docker-compose file + ansible.builtin.git: + repo: 'https://git.bitsathy.ac.in/ShankarMounesh/portainer.bitsathy.ac.in.git' + dest: /srv/portainer.bitsathy.ac.in + +- name: docker-compose + hosts: test + gather_facts: no + tasks: + - name: Create and start services + community.docker.docker_compose: + project_src: /srv/portainer.bitsathy.ac.in/docker + pull: yes + state: absent diff --git a/post_installtion.yaml b/post_installtion.yaml new file mode 100644 index 0000000..0ee3bc1 --- /dev/null +++ b/post_installtion.yaml @@ -0,0 +1,29 @@ +--- + +- hosts: test + become: no + tasks: + - name: update apt + apt: + update_cache: yes + + - name: install docker.io + apt: + name: docker.io + state: present + + - name: install docker-compose + apt: + name: docker-compose + state: present + + - name: install git + apt: + name: git + state: present + + - name: install vim-nux + apt: + name: vim-nox + state: present +