From dbbf9f5e7d1cb734ec1c9b5f9d801bf0a97c203a Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Tue, 2 Aug 2022 22:29:56 +0200 Subject: [PATCH] first commit --- ansible.cfg | 5 +++ deploy.yml | 5 +++ hosts | 2 ++ roles/deploy-web/defaults/main.yml | 2 ++ roles/deploy-web/handlers/main.yml | 2 ++ roles/deploy-web/meta/main.yml | 57 ++++++++++++++++++++++++++++++ roles/deploy-web/tasks/main.yml | 25 +++++++++++++ roles/deploy-web/vars/main.yml | 2 ++ 8 files changed, 100 insertions(+) create mode 100644 ansible.cfg create mode 100644 deploy.yml create mode 100644 hosts create mode 100644 roles/deploy-web/defaults/main.yml create mode 100644 roles/deploy-web/handlers/main.yml create mode 100644 roles/deploy-web/meta/main.yml create mode 100644 roles/deploy-web/tasks/main.yml create mode 100644 roles/deploy-web/vars/main.yml diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..c57b7bd --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,5 @@ +[defaults] +remote_user = admloc +private_key_file = /home/provisioner/.ssh/id_rsa_toolbox +inventory = hosts + diff --git a/deploy.yml b/deploy.yml new file mode 100644 index 0000000..47c229a --- /dev/null +++ b/deploy.yml @@ -0,0 +1,5 @@ +--- +- hosts: all + remote_user: admloc + roles: + - deploy-web diff --git a/hosts b/hosts new file mode 100644 index 0000000..3f15b41 --- /dev/null +++ b/hosts @@ -0,0 +1,2 @@ +centos-test ansible_connection=ssh ansible_host=1.1.110.25 + diff --git a/roles/deploy-web/defaults/main.yml b/roles/deploy-web/defaults/main.yml new file mode 100644 index 0000000..cce7a68 --- /dev/null +++ b/roles/deploy-web/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for deploy-web \ No newline at end of file diff --git a/roles/deploy-web/handlers/main.yml b/roles/deploy-web/handlers/main.yml new file mode 100644 index 0000000..b655c97 --- /dev/null +++ b/roles/deploy-web/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for deploy-web \ No newline at end of file diff --git a/roles/deploy-web/meta/main.yml b/roles/deploy-web/meta/main.yml new file mode 100644 index 0000000..7223799 --- /dev/null +++ b/roles/deploy-web/meta/main.yml @@ -0,0 +1,57 @@ +galaxy_info: + author: your name + description: your description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Some suggested licenses: + # - BSD (default) + # - MIT + # - GPLv2 + # - GPLv3 + # - Apache + # - CC-BY + license: license (GPLv2, CC-BY, etc) + + min_ansible_version: 1.2 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # Optionally specify the branch Galaxy will use when accessing the GitHub + # repo for this role. During role install, if no tags are available, + # Galaxy will use this branch. During import Galaxy will access files on + # this branch. If Travis integration is configured, only notifications for this + # branch will be accepted. Otherwise, in all cases, the repo's default branch + # (usually master) will be used. + #github_branch: + + # + # platforms is a list of platforms, and each platform has a name and a list of versions. + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. \ No newline at end of file diff --git a/roles/deploy-web/tasks/main.yml b/roles/deploy-web/tasks/main.yml new file mode 100644 index 0000000..c22b340 --- /dev/null +++ b/roles/deploy-web/tasks/main.yml @@ -0,0 +1,25 @@ +--- +# tasks file for deploy-web +- name: debug local + local_action: + module: git + repo: "git@gitlab.secu.pcc:descartes/isr-inventory.git" + dest: "/home/provisioner/src/isr-inventory" + archive: "/tmp/isr-inventory.tar.gz" + force: yes + track_submodules: yes + update: yes + key_file: "/home/provisioner/.ssh/id_rsa_toolbox" + run_once: True + become: yes + become_user: provisioner + +- name: Create directory + file: + path: "/home/admloc/isr-inventory" + state: directory + +- name: Extract repo isr + unarchive: + src: "/tmp/isr-inventory.tar.gz" + dest: "/home/admloc/isr-inventory" diff --git a/roles/deploy-web/vars/main.yml b/roles/deploy-web/vars/main.yml new file mode 100644 index 0000000..f38c427 --- /dev/null +++ b/roles/deploy-web/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for deploy-web \ No newline at end of file