This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hello all, I'm trying to figure out a solution. Here is the scope of the project.
My ansible role uses a series of user.yml files stored in multiple submodules to create/update users in Azure AD. When it creates a user, it will update the user.yml file, add, commit, then push the changes back to the submodules repo under a new branch, triggering a pipeline to create a merge request for review. All of this is working as intended when I run it from my local machine, but for production it will be running in AWX. The problem I'm getting is the git metadata doesn't seem to move over from the AWX instance into the AWX_RUNNER instance where the code actually runs. Does anyone have any ideas how I can get this sorted? I'm at my wit's end.
# update_submodules.yml
---
- name: Find all users submodules
find:
paths: "users/"
file_type: directory
register: submodules
- name: Update users submodules
ansible.builtin.include_tasks: _update_submodule.yml
loop: "{{ submodules.files }}"
loop_control:
loop_var: submodule
# _update_submodule.yml
---
- name: Gather date/time
ansible.builtin.setup:
filter: ansible_date_time
- name: Set git branch name
ansible.builtin.set_fact:
branch_name: "ansible-{{ ansible_date_time.iso8601_basic_short }}"
- name: Update client submodule
ansible.builtin.shell:
chdir: "{{ submodule.path }}"
cmd: "git checkout -b {{ branch_name }} && git add . && git commit -m 'ANSIBLE AUTOMATED UPDATES: Adding object_id field for new users created by Ansible' && git push origin HEAD:{{ branch_name }} || true"
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/ansible/com...