Initial commit
This commit is contained in:
237
roles/common/tasks/git.yml
Normal file
237
roles/common/tasks/git.yml
Normal file
@ -0,0 +1,237 @@
|
||||
---
|
||||
|
||||
- name: (git.yml) include variables
|
||||
include_vars: "{{ item }}"
|
||||
with_first_found:
|
||||
- "git-{{ inventory_hostname }}.yml"
|
||||
- "git-{{ ansible_distribution_release }}.yml"
|
||||
- "git-{{ ansible_distribution | lower }}.yml"
|
||||
- git-default.yml
|
||||
tags:
|
||||
- git-default-repositories
|
||||
- git-lxc-guest-repositories
|
||||
- git-apache2-repositories
|
||||
- git-nginx-repositories
|
||||
- git-mysql-server-repositories
|
||||
- git-postgresql-server-repositories
|
||||
- git-nextcloud-server-repositories
|
||||
- git-dns-server-repositories
|
||||
- git-backup-server-repositories
|
||||
- git-samba-server-repositories
|
||||
- git-mailservers-repositories
|
||||
- git-sympa-repositories
|
||||
- git-other-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Default reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update default repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_default_repositories }}'
|
||||
tags:
|
||||
- git-default-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [lxc_guest] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update lxc_guest repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_lxc_guest_repositories }}'
|
||||
when: "groups['lxc_guest']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-lxc-guest-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [lxc_host] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update lxc_host repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_lxc_host_repositories }}'
|
||||
when: "groups['lxc_host']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-lxc-host-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [apache2_webserver] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update apache2 repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_apache2_repositories }}'
|
||||
when: "groups['apache2_webserver']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-apache2-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [nginx_webserver] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update nginx repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_nginx_repositories }}'
|
||||
when: "groups['nginx_webserver']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-nginx-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [mysql_server] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update mysql server repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_mysql_repositories }}'
|
||||
when: "groups['mysql_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-mysql-server-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [postgresql_server] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update postgresql-server repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_postgresql_repositories }}'
|
||||
when: "groups['postgresql_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-postgresql-server-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [nextcloud_server] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update nextcloud server repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_nextcloud_repositories }}'
|
||||
when: "groups['nextcloud_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-nextcloud-server-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [dns_server] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update dns server repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_dns_repositories }}'
|
||||
when: "groups['dns_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-dns-server-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [backup_server] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update backup server repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_backup_repositories }}'
|
||||
when: "groups['backup_server']|string is search(inventory_hostname)"
|
||||
ignore_errors: True
|
||||
tags:
|
||||
- git-backup-server-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [samba_server] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update samba server repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_samba_repositories }}'
|
||||
when: "groups['samba_server']|string is search(inventory_hostname)"
|
||||
ignore_errors: True
|
||||
tags:
|
||||
- git-samba-server-repositories
|
||||
|
||||
|
||||
|
||||
# ---
|
||||
# Group [mail_server] reposotories
|
||||
# ---
|
||||
|
||||
#- name: include variables
|
||||
# include_vars: "git-mailservers.yml"
|
||||
# tags:
|
||||
# - initial-setup
|
||||
# - git
|
||||
# - git-mailservers
|
||||
|
||||
- name: (git.yml) Install/Update default repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_mailserver_repositories }}'
|
||||
when: "groups['mail_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-mailservers-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Group [sympa_list_servers] reposotories
|
||||
# ---
|
||||
|
||||
- name: (git.yml) Install/Update sympa server repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_sympa_repositories }}'
|
||||
when: "groups['sympa_list_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- git-sympa-repositories
|
||||
|
||||
|
||||
# ---
|
||||
# Other (host specific) repositories
|
||||
# ---
|
||||
|
||||
# Read in host specific vars file if exists
|
||||
- name: (git.yml) Include only files matching git-<hostname>.yml (2.2)
|
||||
include_vars:
|
||||
dir: vars
|
||||
extensions:
|
||||
- yml
|
||||
files_matching: "git-{{ inventory_hostname }}.yml"
|
||||
tags:
|
||||
- git-other-repositories
|
||||
|
||||
- name: (git.yml) Install/Update other repositories
|
||||
git:
|
||||
repo: '{{ item.repo }}'
|
||||
dest: '{{ item.dest }}'
|
||||
with_items: '{{ git_other_repositories }}'
|
||||
tags:
|
||||
- git-other-repositories
|
Reference in New Issue
Block a user