Feat: add state

Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
This commit is contained in:
Hadrien Patte 2019-03-23 19:25:04 +01:00
parent e4a60341c5
commit 737ca7b996
No known key found for this signature in database
GPG key ID: 0954F2874A54F4B1
11 changed files with 31 additions and 10 deletions

View file

@ -42,6 +42,7 @@
- name: Install fail2ban - name: Install fail2ban
apt: apt:
name: fail2ban name: fail2ban
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded
@ -79,6 +80,7 @@
- name: Install debsums - name: Install debsums
apt: apt:
name: debsums name: debsums
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded

View file

@ -2,8 +2,9 @@
# For HTTPS apt # For HTTPS apt
- name: Install HTTPS apt - name: Install HTTPS apt
apt: apt:
name: apt-transport-https
update_cache: true update_cache: true
name: apt-transport-https
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded
@ -12,6 +13,7 @@
apt_key: apt_key:
url: https://dl.yarnpkg.com/debian/pubkey.gpg url: https://dl.yarnpkg.com/debian/pubkey.gpg
id: 1646B01B86E50310 id: 1646B01B86E50310
state: present
register: apt_key_result register: apt_key_result
retries: 3 retries: 3
until: apt_key_result is succeeded until: apt_key_result is succeeded
@ -19,12 +21,14 @@
- name: Configure Yarn repository - name: Configure Yarn repository
apt_repository: apt_repository:
repo: deb https://dl.yarnpkg.com/debian/ stable main repo: deb https://dl.yarnpkg.com/debian/ stable main
state: present
# Install CodiMD dependencies # Install CodiMD dependencies
- name: Install required packages - name: Install required packages
apt: apt:
name: yarn
update_cache: true update_cache: true
name: yarn
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded

View file

@ -22,8 +22,9 @@
# Install # Install
- name: Install DokuWiki - name: Install DokuWiki
apt: apt:
name: dokuwiki
update_cache: true update_cache: true
name: dokuwiki
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded

View file

@ -2,8 +2,9 @@
# Install EtherPad dependencies # Install EtherPad dependencies
- name: Install required packages - name: Install required packages
apt: apt:
name: curl
update_cache: true update_cache: true
name: curl
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded

View file

@ -2,11 +2,12 @@
# Install LDAP client packages # Install LDAP client packages
- name: Install LDAP client packages - name: Install LDAP client packages
apt: apt:
update_cache: true
name: name:
- nslcd - nslcd
- libnss-ldapd - libnss-ldapd
- libpam-ldapd - libpam-ldapd
update_cache: true state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded

View file

@ -5,6 +5,7 @@
dest: /etc/ssh/sshd_config dest: /etc/ssh/sshd_config
regexp: ^AllowGroups regexp: ^AllowGroups
line: AllowGroups root sudoldap aurore ssh line: AllowGroups root sudoldap aurore ssh
state: present
# To gain root access with ldap rights # To gain root access with ldap rights
- name: Install SUDO package - name: Install SUDO package
@ -21,6 +22,7 @@
dest: /etc/sudoers dest: /etc/sudoers
regexp: ^%{{ sudo_group }} regexp: ^%{{ sudo_group }}
line: "%{{ sudo_group }} ALL=(ALL:ALL) ALL" line: "%{{ sudo_group }} ALL=(ALL:ALL) ALL"
state: present
# Set sudo location group # Set sudo location group
- name: Configure sudoers sudo location group - name: Configure sudoers sudo location group
@ -28,4 +30,5 @@
dest: /etc/sudoers dest: /etc/sudoers
regexp: ^%{{ sudo_group_location }} regexp: ^%{{ sudo_group_location }}
line: "%{{ sudo_group_location }} ALL=(ALL:ALL) ALL" line: "%{{ sudo_group_location }} ALL=(ALL:ALL) ALL"
state: present
when: sudo_group_location is defined when: sudo_group_location is defined

View file

@ -2,6 +2,7 @@
- name: Install mxisd - name: Install mxisd
apt: apt:
deb: "{{ mxisd_deb }}" deb: "{{ mxisd_deb }}"
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded

View file

@ -2,8 +2,9 @@
# Install HTTPS support for APT # Install HTTPS support for APT
- name: Install apt-transport-https - name: Install apt-transport-https
apt: apt:
name: apt-transport-https
update_cache: true update_cache: true
name: apt-transport-https
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded
@ -12,12 +13,14 @@
- name: Configure riot repository - name: Configure riot repository
apt_repository: apt_repository:
repo: deb https://riot.im/packages/debian/ {{ ansible_distribution_release }} main repo: deb https://riot.im/packages/debian/ {{ ansible_distribution_release }} main
state: present
# Add the key # Add the key
- name: Configure the apt key - name: Configure the apt key
apt_key: apt_key:
url: https://riot.im/packages/debian/repo-key.asc url: https://riot.im/packages/debian/repo-key.asc
id: E019645248E8F4A1 id: E019645248E8F4A1
state: present
register: apt_key_result register: apt_key_result
retries: 3 retries: 3
until: apt_key_result is succeeded until: apt_key_result is succeeded
@ -25,8 +28,9 @@
# Install riot # Install riot
- name: Install riot-web - name: Install riot-web
apt: apt:
name: riot-web
update_cache: true update_cache: true
name: riot-web
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded
@ -35,6 +39,7 @@
- name: Install nginx - name: Install nginx
apt: apt:
name: nginx name: nginx
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded

View file

@ -1,8 +1,9 @@
--- ---
- name: Install matrix-synapse - name: Install matrix-synapse
apt: apt:
name: matrix-synapse
update_cache: true update_cache: true
name: matrix-synapse
state: present
default_release: stretch-backports default_release: stretch-backports
register: apt_result register: apt_result
retries: 3 retries: 3

View file

@ -4,8 +4,9 @@
# but also reduces the surface of attack # but also reduces the surface of attack
- name: Install NGINX server - name: Install NGINX server
apt: apt:
name: nginx-light
update_cache: true update_cache: true
name: nginx-light
state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded

View file

@ -10,11 +10,12 @@
- name: Install required packages - name: Install required packages
apt: apt:
update_cache: true
name: name:
- nodejs - nodejs
- npm - npm
- build-essential # To build npm packages - build-essential # To build npm packages
update_cache: true state: present
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded