Skip to content
Extraits de code Groupes Projets
Valider 61f4d04c rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[UPD] ansible-lint

parent 52fce17e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
---
warn_list: # or 'skip_list' to silence them completely
- git-latest # Git checkouts must contain explicit version
- ignore-errors # Use failed_when and specify error conditions instead of using ignore_errors
- no-changed-when # Commands should not change things if nothing needs doing
- no-handler # Tasks that run when changed should likely be handlers
- package-latest # Package installs should not use latest
---
# Based on ansible-lint config
extends: default
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
# comments enable
comments: enable
comments-indentation: enable
document-start: enable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation:
level: warning
indent-sequences: consistent
spaces: 4
check-multi-line-strings: true
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: enable
new-lines:
type: unix
# trailing-spaces enable
trailing-spaces: enable
truthy: enable
---
# handlers file for gitlab
- name: reconfigure gitlab
command: gitlab-ctl reconfigure
- name: Reconfigure gitlab
ansible.builtin.command: gitlab-ctl reconfigure
---
galaxy_info:
author: Rémi
author: lefilament
description: Role for deploying and configuring GitLab CE edition
company: Le Filament (https://le-filament.com)
license: AGPL-3.0-or-later
min_ansible_version: 2.1
min_ansible_version: "2.1"
platforms:
- name: Ubuntu
versions:
......
---
- name: Install apt-transport-https package
package:
ansible.builtin.package:
name: apt-transport-https
state: latest
async: 120
......@@ -10,20 +10,20 @@
# INSTALLATION
- name: Add GitLab GPG key to APT
get_url:
ansible.builtin.get_url:
url: "{{ gitlab_gpg_key_url }}"
dest: /etc/apt/trusted.gpg.d/gitlab.asc
mode: '0644'
when: ansible_os_family == "Debian"
- name: Add GitLab repo to APT repositories
apt_repository:
ansible.builtin.apt_repository:
repo: deb {{ gitlab_packages_url }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main
update_cache: true
when: ansible_os_family == "Debian"
- name: Install GitLab package
package:
ansible.builtin.package:
name: "{{ packages_to_install }}"
state: latest
async: 900
......@@ -31,30 +31,29 @@
when: not ansible_check_mode
- name: Check installed GitLab package
package:
ansible.builtin.package:
name: gitlab-ce
state: latest
when: ansible_check_mode
- name: Install necessary python modules
pip:
ansible.builtin.pip:
name: ['python-swiftclient', 'python-keystoneclient']
state: latest
# CONFIGURATION
- name: Install gitlab configuration file
template:
ansible.builtin.template:
src: gitlab.rb.j2
dest: "/etc/gitlab/gitlab.rb"
owner: root
group: root
mode: '0600'
notify: reconfigure gitlab
notify: Reconfigure gitlab
# BACKUP
- name: Copy Backup scripts on server
template:
ansible.builtin.template:
src: "{{ item }}.j2"
dest: /root/{{ item }}
owner: root
......@@ -64,7 +63,7 @@
when: inventory_hostname in groups.maintenance_contract
- name: Add cron job to execute backup
cron:
ansible.builtin.cron:
name: "{{ item.name }}"
minute: "{{ item.minute | default('*') }}"
hour: "{{ item.hour | default('*') }}"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter