Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: servers
- vars_files:
- - vars.yml
- - env_vars/production.yml
- gather_facts: false
- tasks:
- - name: Register SSH_AUTH_SOCK variable
- shell: echo $SSH_AUTH_SOCK
- register: ssh_path
- - name: Clone/pull project repo
- git:
- repo: "{{ project_repo }}"
- dest: "{{ install_root }}/{{ project_name }}"
- accept_hostkey: yes
- version: "{{ git_branch }}"
- force: yes
- notify:
- - restart gunicorn
- environment:
- SSH_AUTH_SOCK: "{{ ssh_path.stdout }}"
- register: git_command
- become: yes
- become_user: "{{ gunicorn_user }}"
- ## ansible.cfg in my directory
- [defaults]
- ask_sudo_pass = True
- [ssh_connection]
- ssh_args=-o ControlMaster=auto -o ControlPersist=60s -o ControlPath=/tmp/ansible-ssh-%h-%p-%r -o ForwardAgent=yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement