fix bug when clone repo + rewrite
rewrite the installation of cgit to use git user.
This commit is contained in:
parent
57ff2b71f4
commit
a9513167ca
2 changed files with 65 additions and 74 deletions
7
main.yml
7
main.yml
|
@ -17,13 +17,14 @@
|
|||
################################################################################
|
||||
|
||||
---
|
||||
- name: cgit
|
||||
- name: site
|
||||
hosts: ubuntu
|
||||
become: true
|
||||
become: yes
|
||||
|
||||
vars_files:
|
||||
- vars/sites.yml
|
||||
- vars/cgit.yml
|
||||
- vars/principal.yml
|
||||
vars:
|
||||
pounce_user: "pounce"
|
||||
pounce_home: "/home/{{ pounce_user }}"
|
||||
|
@ -39,6 +40,7 @@
|
|||
- name: installation des paquets nécessaires
|
||||
apt:
|
||||
name:
|
||||
- acl
|
||||
- make
|
||||
- gcc
|
||||
- nginx
|
||||
|
@ -49,6 +51,7 @@
|
|||
|
||||
roles:
|
||||
- cgit
|
||||
- site
|
||||
|
||||
post_tasks:
|
||||
- name: démarrage par défaut de nginx
|
||||
|
|
|
@ -41,8 +41,9 @@
|
|||
name: "{{ git_user }}"
|
||||
shell: "/bin/bash"
|
||||
state: present
|
||||
#groups: "www"
|
||||
|
||||
- name: mise en place de cgit
|
||||
block:
|
||||
- name: clonage de cgit
|
||||
ansible.builtin.git:
|
||||
dest: "{{ path_tmp_cgit }}"
|
||||
|
@ -76,6 +77,11 @@
|
|||
repo: "https://github.com/sitaramc/gitolite"
|
||||
single_branch: yes
|
||||
|
||||
- name: création du dossier bin
|
||||
file:
|
||||
path: "{{ home_user }}/bin"
|
||||
state: directory
|
||||
|
||||
- name: installation de gitolite
|
||||
ansible.builtin.command:
|
||||
cmd: "{{ path_gitolite }}/install -to {{ home_user }}/bin"
|
||||
|
@ -89,43 +95,25 @@
|
|||
ansible.builtin.command:
|
||||
cmd: "{{ home_user }}/bin/gitolite setup -pk /tmp/{{ admin_key }}"
|
||||
|
||||
- name: déplacement des dossiers de configuration de gitolite
|
||||
ansible.builtin.copy:
|
||||
src: "/root/{{ item }}"
|
||||
dest: "{{ home_user }}"
|
||||
remote_src: yes
|
||||
owner: "{{ git_user }}"
|
||||
group: "{{ git_user }}"
|
||||
loop:
|
||||
- ".gitolite"
|
||||
- ".gitolite.rc"
|
||||
- "projects.list"
|
||||
- "repositories"
|
||||
|
||||
- name: configuration des droits du dossier repositories
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ home_user }}/repositories"
|
||||
mode: 0705
|
||||
state: directory
|
||||
recurse: yes
|
||||
|
||||
- name: configuration des droits des dossiers de cgit et gitolite
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
owner: "{{ git_user }}"
|
||||
group: "{{ git_user }}"
|
||||
recurse: yes
|
||||
state: directory
|
||||
loop:
|
||||
- "{{ home_user }}/bin"
|
||||
- "{{ path_cgit }}"
|
||||
- "{{ path_gitolite }}"
|
||||
- name: configuration des droits de la liste des repositories
|
||||
ansible.builtin.file:
|
||||
path: "{{ home_user }}/projects.list"
|
||||
mode: 0705
|
||||
|
||||
- name: configuration des dépots
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ home_user }}/.gitolite.rc"
|
||||
regex: "UMASK"
|
||||
line: "\tUMASK => 0072,"
|
||||
become: yes
|
||||
become_user: git
|
||||
|
||||
- name: configuration de Nginx
|
||||
template:
|
||||
|
|
Loading…
Reference in a new issue