diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..3e0d074 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,19 @@ +--- +galaxy_info: + role_name: ansible-git + author: Will Tome + # yamllint disable-line rule:line-length + description: | + Role to push and pull git repos + company: Ansible by Red Hat + license: GPLv3 + min_ansible_version: 2.8.0.0 + github_branch: master + platforms: + - name: GenericLinux + versions: + - all + galaxy_tags: + - github + - git +dependencies: [] diff --git a/tasks/pull.yml b/tasks/pull.yml index 4b377d2..142d7ee 100644 --- a/tasks/pull.yml +++ b/tasks/pull.yml @@ -4,11 +4,15 @@ - name: set repo path set_fact: git_repo_path: "{{ git_url | regex_search('/(.+).git') | regex_replace('.git', '') }}" - + +- name: debug key + debug: + msg: "{{ lookup('file', git_temp_file.path ) }}" + - name: git clone git: repo: "{{ git_url }}" - dest: "{{ playbook_dir }}/{{ git_repo_path }}" + dest: "{{ playbook_dir }}{{ git_repo_path }}" accept_hostkey: yes key_file: "{{ git_temp_file.path }}" diff --git a/tasks/push.yml b/tasks/push.yml index 3a24b87..3913dd9 100644 --- a/tasks/push.yml +++ b/tasks/push.yml @@ -39,6 +39,10 @@ dest: "{{ playbook_dir }}/.ssh/ssh" content: "ssh -i {{ git_temp_file.path }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $*" mode: 0700 + +- name: debug key + debug: + msg: "{{ lookup('file', git_temp_file.path ) }}" - name: git push shell: git push --force diff --git a/tasks/unpack.yml b/tasks/unpack.yml index ac2ff68..b736dbc 100644 --- a/tasks/unpack.yml +++ b/tasks/unpack.yml @@ -8,7 +8,7 @@ tempfile: path: "{{ playbook_dir }}/.ssh" register: git_temp_file - + - name: copy key to temp file copy: content: "{{ git_key }}"