diff --git a/ansible.cfg b/ansible.cfg deleted file mode 100644 index c57b7bd..0000000 --- a/ansible.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[defaults] -remote_user = admloc -private_key_file = /home/provisioner/.ssh/id_rsa_toolbox -inventory = hosts - diff --git a/hosts b/hosts deleted file mode 100644 index 3f15b41..0000000 --- a/hosts +++ /dev/null @@ -1,2 +0,0 @@ -centos-test ansible_connection=ssh ansible_host=1.1.110.25 - diff --git a/inventory/host_vars/vps-host b/inventory/host_vars/vps-host new file mode 100644 index 0000000..3284deb --- /dev/null +++ b/inventory/host_vars/vps-host @@ -0,0 +1,12 @@ +$ANSIBLE_VAULT;1.1;AES256 +39343765633561393532373365313435383266313661663666643731356262633063643761633662 +3732306165616334373164303133336565343939643939330a353635613432313230356237306330 +39653132363064323961396162383563303334323930396338303566656632663666626337303662 +3338323062366239650a366338346462363565343735643930663338376537343962656534393732 +36363331353832626261656461636636613332643964336634353963313332356366663739363238 +65356661333639313666383931323363306165643038653164313939376637386666303661363737 +63386466373961623736656635633433333461353435646336323738636334353337313535333663 +30356236363561613630666465663464383965376162653164613431616336336466316330376430 +61396238626364656461666163623234316533663234613931623138376564303236633163626337 +66303734346561613636353239646461626439303537393265353532323233656536663362636164 +656534363934393039623035656335353839 diff --git a/inventory/hosts b/inventory/hosts new file mode 100644 index 0000000..f217535 --- /dev/null +++ b/inventory/hosts @@ -0,0 +1 @@ +vps-host ansible_connection=ssh ansible_host=51.222.107.37 ansible_port=2424 ansible_user=valentin diff --git a/roles/deploy-web/tasks/main.yml b/roles/deploy-web/tasks/main.yml index c22b340..9acb1a8 100644 --- a/roles/deploy-web/tasks/main.yml +++ b/roles/deploy-web/tasks/main.yml @@ -1,25 +1,29 @@ --- # tasks file for deploy-web -- name: debug local + +- name: git archive {{ item }} 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" + repo: "https://{{ git_username | urlencode }}:{{ git_password | urlencode }}@git.valczeryba.ovh/v4l3n71n/{{ project_name }}.git" + dest: "/home/valentin/src/" + archive: "/tmp/{{ item }}.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 + with_items: "{{ project_name }}" + when: "project_name is defined" -- name: Create directory + +- name: Create directory {{ item }} file: - path: "/home/admloc/isr-inventory" + path: "/var/www/{{ item }}" state: directory + with_items: "{{ project_name }}" + when: "project_name is defined" -- name: Extract repo isr + +- name: Extract repo {{ item }} unarchive: - src: "/tmp/isr-inventory.tar.gz" - dest: "/home/admloc/isr-inventory" + src: "/tmp/{{ item }}.tar.gz" + dest: "/var/www/{{ item }}" + with_items: "{{ project_name }}" + when: "project_name is defined"