- name: Deploy Application hosts: all become: yes become_method: sudo vars_files: - vars/main.yml pre_tasks: - debug: msg: "{{nginx_reverse_proxy_port}}" - debug: msg: "{{nginx_listen_port}}" - name: Excute base roles for apps(step1) block: - name: Include base roles include_role: name: "{{item}}" with_items: - role_common - role_cloud - name: Git Clone app docker repository(step2) block: - name: Create app directory shell: mkdir -p {{installpath}} - name: Delete {{appname}} dir for sec_installation shell: rm -rf {{installpath}}/{{appname}} - name: Clone {{appname}} in Websoft9 git: repo: "https://github.com/Websoft9/docker-{{appname}}.git" dest: "{{installpath}}/{{appname}}" - name: Excute Preparation if have pre.yml(step3) block: - name: Check if pre.yml exists uri: url: "https://github.com/Websoft9/StackHub/blob/main/apps/roles/{{appname}}/tasks/pre.yml" return_content: yes register: pre_exists failed_when: false - name: Excute pre.yml include_tasks: roles/{{appname}}/tasks/pre.yml when: pre_exists.status is defined and pre_exists.status == 200 roles: - { role: "{{appname}}", tags: "{{appname}}" } - { role: role_nginx, tags: "role_nginx" } - { role: install, tags: "install" } - { role: role_init, tags: "role_init" } - { role: role_preend, tags: "preend" } - { role: role_end, tags: "role_end" }