Clone repository via HTTP or HTTPS
- requirements.yml
---
- name: gitops
src: fabiocruzcoelho.gitops
ansible-galaxy install -r requirements.yml
Available variables are along with default values see: defaults/main.yml
---
- name: Lint it
hosts: localhost
gather_facts: yes
become: yes
vars:
git_project_name: gitops
git_clone_path: "/projects/{{ git_project_name }}"
git_username: ''
git_password: ''
tasks:
- name: Git clone
include_role:
name: gitops
vars:
gitops_clone: yes
gitops:
repo_path: "{{ git_clone_path }}"
username: "{{ git_username }}"
password: "{{ git_password }}"
protocol: http
url: gitlab.com
repo_uri: /ansible/roles/{{ git_project_name }}.git
branch: master
- name: Create new file
file:
path: "{{ git_clone_path }}/foo.conf"
state: touch
- name: Git commit
include_role:
name: gitops
vars:
gitops_commit: yes
gitops:
username: "{{ git_username }}"
email: [email protected]
msg: 'Added: new Virtual Host by Ansble'
repo_path: "{{ git_clone_path }}"
Dependence
git clone https://gitlab.com/estudosdevops/ansible/roles/gitops.git
make test
👤 Fabio Coelho
- Twitter: @fcruzcoelho
- Github: @fabiocruzcoelho
- LinkedIn: @fcruzcoelho
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2020 Fabio Coelho.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator