chore: Refactor git commands to git_acp module
This commit is contained in:
parent
3e3a92c344
commit
eb2ada2164
@ -122,8 +122,8 @@
|
|||||||
- organization: wl
|
- organization: wl
|
||||||
body:
|
body:
|
||||||
name: GitOps.Config
|
name: GitOps.Config
|
||||||
# auto_init: true
|
auto_init: true
|
||||||
# default_branch: main
|
default_branch: main
|
||||||
description: GitOps manifests
|
description: GitOps manifests
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.organization ~ '/' ~ item.body.name }}"
|
label: "{{ item.organization ~ '/' ~ item.body.name }}"
|
||||||
|
@ -5,6 +5,12 @@
|
|||||||
recurse: false
|
recurse: false
|
||||||
register: helm_charts
|
register: helm_charts
|
||||||
|
|
||||||
|
- name: Pull existing repository
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: https://git.{{ vapp['metacluster.fqdn'] }}/wl/GitOps.Config.git
|
||||||
|
dest: /opt/workloadcluster/git-repositories/gitops
|
||||||
|
version: main
|
||||||
|
|
||||||
- name: Create hard-links to populate new git-repository
|
- name: Create hard-links to populate new git-repository
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: >-
|
cmd: >-
|
||||||
@ -41,18 +47,32 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.key }}"
|
label: "{{ item.key }}"
|
||||||
|
|
||||||
- name: Initialize/Push git repository
|
- name: Push git repository
|
||||||
ansible.builtin.shell:
|
lvrfrc87.git_acp.git_acp:
|
||||||
cmd: |
|
path: /opt/workloadcluster/git-repositories/gitops
|
||||||
git init
|
branch: main
|
||||||
git config --global user.email "administrator@{{ vapp['metacluster.fqdn'] }}"
|
comment: "Upload charts"
|
||||||
git config --global user.name "administrator"
|
add:
|
||||||
git checkout -b main
|
- .
|
||||||
git add .
|
url: https://administrator:{{ vapp['metacluster.password'] | urlencode }}@git.{{ vapp['metacluster.fqdn'] }}/wl/GitOps.Config.git
|
||||||
git commit -m "Upload charts"
|
environment:
|
||||||
git remote add origin https://git.{{ vapp['metacluster.fqdn'] }}/wl/GitOps.Config.git
|
GIT_AUTHOR_NAME: administrator
|
||||||
git push https://administrator:{{ vapp['metacluster.password'] | urlencode }}@git.{{ vapp['metacluster.fqdn'] }}/wl/GitOps.Config.git --all
|
GIT_AUTHOR_EMAIL: administrator@{{ vapp['metacluster.fqdn'] }}
|
||||||
chdir: /opt/workloadcluster/git-repositories/gitops
|
GIT_COMMITTER_NAME: administrator
|
||||||
|
GIT_COMMITTER_EMAIL: administrator@{{ vapp['metacluster.fqdn'] }}
|
||||||
|
|
||||||
|
# - name: Initialize/Push git repository
|
||||||
|
# ansible.builtin.shell:
|
||||||
|
# cmd: |
|
||||||
|
# git init
|
||||||
|
# git config --global user.email "administrator@{{ vapp['metacluster.fqdn'] }}"
|
||||||
|
# git config --global user.name "administrator"
|
||||||
|
# git checkout -b main
|
||||||
|
# git add .
|
||||||
|
# git commit -m "Upload charts"
|
||||||
|
# git remote add origin https://git.{{ vapp['metacluster.fqdn'] }}/wl/GitOps.Config.git
|
||||||
|
# git push https://administrator:{{ vapp['metacluster.password'] | urlencode }}@git.{{ vapp['metacluster.fqdn'] }}/wl/GitOps.Config.git --all
|
||||||
|
# chdir: /opt/workloadcluster/git-repositories/gitops
|
||||||
|
|
||||||
- name: Retrieve workload-cluster kubeconfig
|
- name: Retrieve workload-cluster kubeconfig
|
||||||
kubernetes.core.k8s_info:
|
kubernetes.core.k8s_info:
|
||||||
|
Loading…
Reference in New Issue
Block a user