refactor: standardize tasks’ name

This commit is contained in:
VC
2024-07-05 11:53:35 +02:00
parent 788dfae081
commit 85f0f91887
36 changed files with 114 additions and 138 deletions

View File

@@ -8,7 +8,7 @@
- dovecot-sieve - dovecot-sieve
- dovecot-lmtpd - dovecot-lmtpd
- name: Main configuration file - name: Put main configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: ./files/dovecot.conf src: ./files/dovecot.conf
dest: /etc/dovecot/dovecot.conf dest: /etc/dovecot/dovecot.conf
@@ -16,7 +16,7 @@
notify: notify:
- Restart dovecot - Restart dovecot
- name: Sieve configuration file - name: Put sieve configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: ./files/before.sieve src: ./files/before.sieve
dest: /etc/dovecot/before.sieve dest: /etc/dovecot/before.sieve

View File

@@ -1,6 +1,6 @@
--- ---
- name: Generate firewall file - name: Put firewall file
ansible.builtin.template: ansible.builtin.template:
src: firewall.j2 src: firewall.j2
dest: /etc/config/firewall dest: /etc/config/firewall

View File

@@ -27,7 +27,7 @@
state: directory state: directory
mode: 0755 mode: 0755
- name: Config vsftpd - name: Put vsftpd config file
ansible.builtin.copy: ansible.builtin.copy:
src: files/vsftpd.conf src: files/vsftpd.conf
dest: /etc/vsftpd.conf dest: /etc/vsftpd.conf

View File

@@ -5,7 +5,7 @@
name: haproxy name: haproxy
state: present state: present
- name: Haproxy config - name: Put haproxy config file
ansible.builtin.template: ansible.builtin.template:
src: haproxy.cfg.j2 src: haproxy.cfg.j2
dest: /etc/haproxy/haproxy.cfg dest: /etc/haproxy/haproxy.cfg

View File

@@ -5,7 +5,7 @@
name: icecast2 name: icecast2
state: present state: present
- name: Configuration file - name: Put icecast2 configuration file
ansible.builtin.template: ansible.builtin.template:
src: icecast.xml.j2 src: icecast.xml.j2
dest: /etc/icecast2/icecast.xml dest: /etc/icecast2/icecast.xml

View File

@@ -19,14 +19,14 @@
creates: /srv/mysql/ibdata1 creates: /srv/mysql/ibdata1
notify: Restart mariadb notify: Restart mariadb
- name: Replace conffile - name: Put mariadb configuration file
ansible.builtin.template: ansible.builtin.template:
src: 50-server.cnf.j2 src: 50-server.cnf.j2
dest: /etc/mysql/mariadb.conf.d/50-server.cnf dest: /etc/mysql/mariadb.conf.d/50-server.cnf
mode: 0644 mode: 0644
notify: Restart mariadb notify: Restart mariadb
- name: Debian upgrade file conf - name: Upgrade debian configuration file
ansible.builtin.template: ansible.builtin.template:
src: debian.cnf.j2 src: debian.cnf.j2
dest: /etc/mysql/debian.cnf dest: /etc/mysql/debian.cnf
@@ -48,7 +48,7 @@
path: /root/.my.cnf path: /root/.my.cnf
register: dot_my_cnf register: dot_my_cnf
- name: Root password - name: Set root password
community.mysql.mysql_user: community.mysql.mysql_user:
login_unix_socket: "/var/run/mysqld/mysqld.sock" login_unix_socket: "/var/run/mysqld/mysqld.sock"
host: localhost host: localhost
@@ -62,7 +62,7 @@
dest: ~/.my.cnf dest: ~/.my.cnf
mode: '0600' mode: '0600'
- name: Root password (follow-up) - name: Set root password (follow-up)
community.mysql.mysql_user: community.mysql.mysql_user:
login_user: root login_user: root
host: "{{ item }}" host: "{{ item }}"
@@ -73,7 +73,7 @@
- "127.0.0.1" - "127.0.0.1"
- "::1" - "::1"
- name: Scripted version of mysql_secure_installation - name: Exec scripted version of mysql_secure_installation
ansible.builtin.command: ansible.builtin.command:
cmd: "{{ item }}" cmd: "{{ item }}"
creates: ~/mysql_secure_installation creates: ~/mysql_secure_installation

View File

@@ -9,7 +9,7 @@
- name: Install redis - name: Install redis
ansible.builtin.include_tasks: redis.yml ansible.builtin.include_tasks: redis.yml
- name: Mastodon user - name: Create mastodon user
ansible.builtin.user: ansible.builtin.user:
name: mastodon name: mastodon
comment: "John Mastodon" comment: "John Mastodon"
@@ -17,7 +17,7 @@
shell: /bin/bash shell: /bin/bash
home: "{{ mastodon_home }}" home: "{{ mastodon_home }}"
- name: Mastodon .ssh dir - name: Create mastodon .ssh dir
ansible.builtin.file: ansible.builtin.file:
state: directory state: directory
path: "{{ mastodon_home }}/.ssh" path: "{{ mastodon_home }}/.ssh"
@@ -25,7 +25,7 @@
owner: mastodon owner: mastodon
group: mastodon group: mastodon
- name: Ssh for mastodon user - name: Set ssh for mastodon user
ansible.builtin.copy: ansible.builtin.copy:
remote_src: true remote_src: true
src: /root/.ssh/authorized_keys src: /root/.ssh/authorized_keys

View File

@@ -1,13 +1,13 @@
--- ---
- name: Git mastodon - name: Get mastodon git
remote_user: mastodon remote_user: mastodon
ansible.builtin.git: ansible.builtin.git:
repo: "https://github.com/mastodon/mastodon.git" repo: "https://github.com/mastodon/mastodon.git"
dest: "{{ mastodon_home }}/live" dest: "{{ mastodon_home }}/live"
version: "v{{ mastodon_version }}" version: "v{{ mastodon_version }}"
- name: Bundle config command - name: Exec bundle
remote_user: mastodon remote_user: mastodon
ansible.builtin.command: ansible.builtin.command:
cmd: | cmd: |
@@ -15,7 +15,7 @@
creates: "{{ mastodon_home }}/.bundle/config" creates: "{{ mastodon_home }}/.bundle/config"
chdir: "{{ mastodon_home }}/live" chdir: "{{ mastodon_home }}/live"
- name: Bundle install - name: Install bundle
remote_user: mastodon remote_user: mastodon
ansible.builtin.command: ansible.builtin.command:
cmd: | cmd: |
@@ -23,7 +23,7 @@
chdir: "{{ mastodon_home }}/live" chdir: "{{ mastodon_home }}/live"
changed_when: true changed_when: true
- name: Yarn install - name: Install yarn
remote_user: mastodon remote_user: mastodon
ansible.builtin.command: ansible.builtin.command:
cmd: | cmd: |
@@ -38,7 +38,7 @@
state: directory state: directory
mode: '0750' mode: '0750'
- name: Template scripts - name: Put template scripts
remote_user: mastodon remote_user: mastodon
ansible.builtin.template: ansible.builtin.template:
src: "{{ item }}.j2" src: "{{ item }}.j2"

View File

@@ -7,12 +7,12 @@
force: true force: true
mode: 0644 mode: 0644
- name: Gpg dearmor key - name: Dearmor gpg key
ansible.builtin.command: ansible.builtin.command:
cmd: "gpg --dearmor --yes -o {{ mastodon_nodejs_key_path }} /tmp/nodesource.gpg.key" cmd: "gpg --dearmor --yes -o {{ mastodon_nodejs_key_path }} /tmp/nodesource.gpg.key"
changed_when: true changed_when: true
- name: Node source repo - name: Set node source repo
ansible.builtin.copy: ansible.builtin.copy:
content: "deb [signed-by={{ mastodon_nodejs_key_path }}] https://deb.nodesource.com/node_16.x {{ ansible_facts['distribution_release'] }} main" content: "deb [signed-by={{ mastodon_nodejs_key_path }}] https://deb.nodesource.com/node_16.x {{ ansible_facts['distribution_release'] }} main"
dest: /etc/apt/sources.list.d/nodesource.list dest: /etc/apt/sources.list.d/nodesource.list

View File

@@ -1,6 +1,6 @@
--- ---
- name: Git rbenv - name: Get rbenv git
remote_user: mastodon remote_user: mastodon
ansible.builtin.git: ansible.builtin.git:
repo: "https://github.com/rbenv/rbenv.git" repo: "https://github.com/rbenv/rbenv.git"
@@ -8,7 +8,7 @@
single_branch: true single_branch: true
version: master version: master
- name: Git ruby-build - name: Get ruby-build git
remote_user: mastodon remote_user: mastodon
ansible.builtin.git: ansible.builtin.git:
repo: https://github.com/rbenv/ruby-build.git repo: https://github.com/rbenv/ruby-build.git

View File

@@ -7,12 +7,12 @@
mode: 0644 mode: 0644
force: true force: true
- name: Gpg dearmor key - name: Dearmor gpg key
ansible.builtin.command: ansible.builtin.command:
cmd: "gpg --dearmor --yes -o {{ mastodon_yarn_key_path }} /tmp/yarn.gpg.key" cmd: "gpg --dearmor --yes -o {{ mastodon_yarn_key_path }} /tmp/yarn.gpg.key"
changed_when: true changed_when: true
- name: Yarn source repo - name: Set yarn source repo
ansible.builtin.copy: ansible.builtin.copy:
content: "deb [signed-by={{ mastodon_yarn_key_path }}] https://dl.yarnpkg.com/debian stable main" content: "deb [signed-by={{ mastodon_yarn_key_path }}] https://dl.yarnpkg.com/debian stable main"
dest: /etc/apt/sources.list.d/yarn.list dest: /etc/apt/sources.list.d/yarn.list

View File

@@ -5,7 +5,7 @@
name: mumble-server name: mumble-server
state: present state: present
- name: Configuration files - name: Put configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: ./files/mumble-server.ini src: ./files/mumble-server.ini
dest: /etc/mumble-server.ini dest: /etc/mumble-server.ini

View File

@@ -22,7 +22,7 @@
state: present state: present
loop: "{{ muninpkgs }}" loop: "{{ muninpkgs }}"
- name: Munin-node conf file - name: Put munin-node configuration file
ansible.builtin.template: ansible.builtin.template:
src: munin-node.conf.j2 src: munin-node.conf.j2
dest: /etc/munin/munin-node.conf dest: /etc/munin/munin-node.conf
@@ -42,7 +42,7 @@
when: "'webservers' in group_names or 'loadbalancers' in group_names" when: "'webservers' in group_names or 'loadbalancers' in group_names"
# for HAProxy servers # for HAProxy servers
- name: Add HAProxy backend module - name: Add haproxy backend module
ansible.builtin.file: ansible.builtin.file:
src: /usr/share/munin/plugins/haproxy_ src: /usr/share/munin/plugins/haproxy_
dest: /etc/munin/plugins/haproxy_current dest: /etc/munin/plugins/haproxy_current
@@ -110,7 +110,7 @@
- users - users
## Useless junks for LXC ## Useless junks for LXC
- name: "Delete junks from LXC machines" - name: Delete junks for LXC containers
ansible.builtin.file: ansible.builtin.file:
path: "/etc/munin/plugins/{{ item }}" path: "/etc/munin/plugins/{{ item }}"
state: absent state: absent

View File

@@ -5,7 +5,7 @@
name: munin name: munin
state: present state: present
- name: Munin conf file - name: Put munin configuration file
ansible.builtin.template: ansible.builtin.template:
src: munin.conf.j2 src: munin.conf.j2
dest: /etc/munin/munin.conf dest: /etc/munin/munin.conf

View File

@@ -10,7 +10,7 @@
cmd: /usr/bin/openssl dhparam -out /etc/nginx/dhparam.pem 2048 cmd: /usr/bin/openssl dhparam -out /etc/nginx/dhparam.pem 2048
creates: /etc/nginx/dhparam.pem creates: /etc/nginx/dhparam.pem
- name: Put configuration files - name: Put nginx configuration files
ansible.builtin.template: ansible.builtin.template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"

View File

@@ -1,18 +1,18 @@
--- ---
- name: Rnstall nut client - name: Install nut client
ansible.builtin.package: ansible.builtin.package:
name: nut-client name: nut-client
state: present state: present
- name: Upsmon.conf file - name: Put upsmon configuration file
ansible.builtin.template: ansible.builtin.template:
src: upsmon.conf.j2 src: upsmon.conf.j2
dest: /etc/nut/upsmon.conf dest: /etc/nut/upsmon.conf
mode: '0640' mode: '0640'
notify: Restart nut-client notify: Restart nut-client
- name: Nut.conf file - name: Put nut configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: files/nut.conf src: files/nut.conf
dest: /etc/nut/nut.conf dest: /etc/nut/nut.conf

View File

@@ -5,10 +5,13 @@
name: nut-server name: nut-server
state: restarted state: restarted
- name: Udev - name: Reload udev
ansible.builtin.shell: ansible.builtin.command:
cmd: "udevadm control --reload-rules && udevadm trigger" cmd: "{{ item }}"
changed_when: false changed_when: true
loop:
- udevadm control --reload-rules
- udevadm trigger
- name: Restart nut-driver - name: Restart nut-driver
ansible.builtin.service: ansible.builtin.service:

View File

@@ -5,37 +5,27 @@
name: nut-server name: nut-server
state: present state: present
- name: Udev conf file for nut - name: Put udev configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: files/90-nut-ups.rules src: files/90-nut-ups.rules
dest: /etc/udev/rules.d/90-nut-ups.rules dest: /etc/udev/rules.d/90-nut-ups.rules
mode: 0644 mode: 0644
notify: notify:
- Udev - Reload udev
- Restart nut-driver - Restart nut-driver
- name: Nut.conf file - name: Put nut configuration files
ansible.builtin.copy: ansible.builtin.copy:
src: files/nut.conf src: "{{ item.src }}"
dest: /etc/nut/nut.conf dest: "{{ item.dest }}"
mode: '0640' mode: 0640
loop:
- {src: "files/nut.conf", dest: "/etc/nut/nut.conf"}
- {src: "files/ups.conf", dest: "/etc/nut/ups.conf"}
- {src: "files/upsd.conf", dest: "/etc/nut/upsd.conf"}
notify: Restart nut-server notify: Restart nut-server
- name: Ups.conf file - name: Put upsd users file
ansible.builtin.copy:
src: files/ups.conf
dest: /etc/nut/ups.conf
mode: '0640'
notify: Restart nut-server
- name: Upsd.conf file
ansible.builtin.copy:
src: files/upsd.conf
dest: /etc/nut/upsd.conf
mode: '0640'
notify: Restart nut-server
- name: Upsd.users file
ansible.builtin.template: ansible.builtin.template:
src: upsd.users.j2 src: upsd.users.j2
dest: /etc/nut/upsd.users dest: /etc/nut/upsd.users

View File

@@ -8,7 +8,7 @@
- opendkim - opendkim
- opendkim-tools - opendkim-tools
- name: Main configuration files - name: Put main configuration file
ansible.builtin.template: ansible.builtin.template:
src: opendkim.conf src: opendkim.conf
dest: /etc/opendkim.conf dest: /etc/opendkim.conf
@@ -16,13 +16,13 @@
notify: notify:
- Restart opendkim - Restart opendkim
- name: Dkim directory - name: Create dkim directory
ansible.builtin.file: ansible.builtin.file:
path: /etc/dkim path: /etc/dkim
state: directory state: directory
mode: 0755 mode: 0755
- name: Secondary configuration files - name: Put secondary configuration files
ansible.builtin.copy: ansible.builtin.copy:
src: "./files/dkim/{{ item }}" src: "./files/dkim/{{ item }}"
dest: "/etc/dkim/{{ item }}" dest: "/etc/dkim/{{ item }}"

View File

@@ -5,7 +5,7 @@
name: opendmarc name: opendmarc
state: present state: present
- name: Opendmarc config file - name: Put opendmarc configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: ./files/opendmarc.conf src: ./files/opendmarc.conf
dest: /etc/opendmarc.conf dest: /etc/opendmarc.conf
@@ -13,13 +13,13 @@
notify: notify:
- restart opendmarc - restart opendmarc
- name: Dmarc directory - name: Create dmarc directory
ansible.builtin.file: ansible.builtin.file:
path: /etc/dmarc path: /etc/dmarc
state: directory state: directory
mode: 0755 mode: 0755
- name: Secondary configuration files - name: Put secondary configuration files
ansible.builtin.copy: ansible.builtin.copy:
src: "./files/dmarc/{{ item }}" src: "./files/dmarc/{{ item }}"
dest: "/etc/dmarc/{{ item }}" dest: "/etc/dmarc/{{ item }}"

View File

@@ -5,23 +5,18 @@
name: php-fpm name: php-fpm
state: present state: present
- name: Configure php-fpm - name: Put php-fpm configuration files
ansible.builtin.template: ansible.builtin.template:
src: www.conf.j2 src: "{{ item.src }}"
dest: /etc/php/{{ php_version }}/fpm/pool.d/www.conf dest: "{{ item.dest }}"
mode: 0644 mode: 0644
loop:
- {src: "www.conf.j2", dest: "/etc/php/{{ php_version }}/fpm/pool.d/www.conf"}
- {src: "php.ini.j2", dest: "/etc/php/{{ php_version }}/fpm/php.ini"}
notify: notify:
- Restart php-fpm - Restart php-fpm
- name: Configure php - name: Install lib for php-fpm
ansible.builtin.template:
src: php.ini.j2
dest: /etc/php/{{ php_version }}/fpm/php.ini
mode: 0644
notify:
- Restart php-fpm
- name: Install lib for php
ansible.builtin.package: ansible.builtin.package:
name: "php-{{ item }}" name: "php-{{ item }}"
state: present state: present

View File

@@ -10,7 +10,7 @@
name: mailutils name: mailutils
state: present state: present
- name: Main configuration files - name: Put main configuration files
ansible.builtin.copy: ansible.builtin.copy:
src: "./files/{{ item }}" src: "./files/{{ item }}"
dest: "/etc/postfix/{{ item }}" dest: "/etc/postfix/{{ item }}"
@@ -21,7 +21,7 @@
notify: notify:
- Restart postfix - Restart postfix
- name: Map files - name: Put map files
ansible.builtin.copy: ansible.builtin.copy:
src: "./files/{{ item }}" src: "./files/{{ item }}"
dest: "/etc/postfix/{{ item }}" dest: "/etc/postfix/{{ item }}"
@@ -33,7 +33,7 @@
- Postmap files - Postmap files
- Restart postfix - Restart postfix
- name: Mail generation script - name: Put mail generation script
ansible.builtin.copy: ansible.builtin.copy:
src: ./files/generate_email.sh src: ./files/generate_email.sh
dest: /usr/local/bin/generate_email.sh dest: /usr/local/bin/generate_email.sh

View File

@@ -21,18 +21,14 @@
become_user: postgres become_user: postgres
notify: Restart postgres notify: Restart postgres
- name: Replace main conffile - name: Put main configuration files
ansible.builtin.copy: ansible.builtin.copy:
src: files/postgresql.conf src: "{{ item.src }}"
dest: "/etc/postgresql/{{ pg_version }}/main/postgresql.conf" dest: "{{ item.dest }}"
mode: 0644 mode: "{{ item.mode }}"
notify: Restart postgres loop:
- {src: "files/postgresql.conf", dest: "/etc/postgresql/{{ pg_version }}/main/postgresql.conf", mode: "0644"}
- name: Replace pg_hba file - {src: "files/pg_hba.conf", dest: "/etc/postgresql/{{ pg_version }}/main/pg_hba.conf", mode: "0640"}
ansible.builtin.copy:
src: files/pg_hba.conf
dest: "/etc/postgresql/{{ pg_version }}/main/pg_hba.conf"
mode: 0640
notify: Restart postgres notify: Restart postgres
- name: Create backup dir - name: Create backup dir
@@ -43,7 +39,7 @@
state: directory state: directory
mode: 0755 mode: 0755
- name: Backup pg databases - name: Cron backup script
ansible.builtin.cron: ansible.builtin.cron:
user: postgres user: postgres
minute: "0" minute: "0"

View File

@@ -15,7 +15,7 @@
group: root group: root
mode: '0750' mode: '0750'
- name: Cron the backup script - name: Cron backup script
ansible.builtin.cron: ansible.builtin.cron:
name: "restic backup script" name: "restic backup script"
hour: "{{ restic_backup_hour }}" hour: "{{ restic_backup_hour }}"

View File

@@ -5,7 +5,7 @@
name: rsyslog name: rsyslog
state: present state: present
- name: Put log concentration file - name: Put log configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: files/sys.conf src: files/sys.conf
dest: /etc/rsyslog.d/sys.conf dest: /etc/rsyslog.d/sys.conf
@@ -13,7 +13,7 @@
notify: Restart rsyslog notify: Restart rsyslog
when: "'rsyslogservers' in group_names" when: "'rsyslogservers' in group_names"
- name: Put rsyslog config file - name: Put rsyslog configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: files/remote.conf src: files/remote.conf
dest: /etc/rsyslog.d/remote.conf dest: /etc/rsyslog.d/remote.conf

View File

@@ -9,17 +9,14 @@
file: smtp_remap.yml file: smtp_remap.yml
when: smtprelay_origin not in ["mateu.be"] when: smtprelay_origin not in ["mateu.be"]
- name: Install postfix smtp server - name: Install packages
ansible.builtin.package: ansible.builtin.package:
name: postfix name:
- postfix
- libsasl2-modules
state: present state: present
- name: Install libsasl2 - name: Put sasl_passwd configuration file
ansible.builtin.package:
name: libsasl2-modules
state: present
- name: Install sasl_passwd file
ansible.builtin.template: ansible.builtin.template:
src: sasl_passwd.j2 src: sasl_passwd.j2
dest: /etc/postfix/sasl_passwd dest: /etc/postfix/sasl_passwd
@@ -28,7 +25,7 @@
- Postmap sasl_passwd - Postmap sasl_passwd
- Restart postfix - Restart postfix
- name: Install default postfix main.cf - name: Put postfix configuration file
ansible.builtin.template: ansible.builtin.template:
src: main.cf.j2 src: main.cf.j2
dest: /etc/postfix/main.cf dest: /etc/postfix/main.cf

View File

@@ -9,18 +9,13 @@
- libmail-dkim-perl - libmail-dkim-perl
- libmail-spf-perl - libmail-spf-perl
- name: Main configuration files - name: Put configuration files
ansible.builtin.copy: ansible.builtin.copy:
src: ./files/local.cf src: "{{ item.src }}"
dest: /etc/spamassassin/local.cf dest: "{{ item.dest }}"
mode: 0644
notify:
- Restart spamassassin
- name: Default configuration files
ansible.builtin.copy:
src: ./files/spamassassin
dest: /etc/default/spamassassin
mode: 0644 mode: 0644
loop:
- {src: "./files/local.cf", dest: "/etc/spamassassin/local.cf"}
- {src: "./files/spamassassin", dest: "/etc/default/spamassassin"}
notify: notify:
- Restart spamassassin - Restart spamassassin

View File

@@ -60,7 +60,7 @@
changed_when: true changed_when: true
when: ansible_facts['env']['LANG'] != 'fr_FR.UTF-8' when: ansible_facts['env']['LANG'] != 'fr_FR.UTF-8'
- name: Copy bashrc config file - name: Put bashrc configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: files/dotbashrc src: files/dotbashrc
dest: /root/.bashrc dest: /root/.bashrc
@@ -68,7 +68,7 @@
owner: root owner: root
group: root group: root
- name: Copy vimrc config file - name: Put vimrc configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: files/vim/ src: files/vim/
dest: /root/.vim dest: /root/.vim
@@ -76,9 +76,9 @@
owner: root owner: root
group: root group: root
- name: SSH configuration - name: Config ssh
block: block:
- name: Put SSH configuration file - name: Put ssh configuration file
ansible.builtin.template: ansible.builtin.template:
src: sshd_config.j2 src: sshd_config.j2
dest: /etc/ssh/sshd_config dest: /etc/ssh/sshd_config
@@ -86,19 +86,19 @@
notify: notify:
- Restart sshd - Restart sshd
- name: SSH key home - name: Put ssh key home
ansible.posix.authorized_key: ansible.posix.authorized_key:
user: root user: root
state: present state: present
key: "{{ lookup('file', 'ssh/home.id_rsa.pub') }}" key: "{{ lookup('file', 'ssh/home.id_rsa.pub') }}"
- name: SSH key work - name: Put ssh key work
ansible.posix.authorized_key: ansible.posix.authorized_key:
user: root user: root
state: present state: present
key: "{{ lookup('file', 'ssh/work.id_rsa.pub') }}" key: "{{ lookup('file', 'ssh/work.id_rsa.pub') }}"
- name: SSH key stef - name: Put ssh key stef
ansible.posix.authorized_key: ansible.posix.authorized_key:
user: root user: root
state: present state: present
@@ -106,7 +106,7 @@
path: "~/.ssh/instance_keys" path: "~/.ssh/instance_keys"
when: inventory_hostname in groups['fedinupesservers'] when: inventory_hostname in groups['fedinupesservers']
- name: Set cron-apt configuration file - name: Put cron-apt configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: files/5-install src: files/5-install
dest: /etc/cron-apt/action.d/5-install dest: /etc/cron-apt/action.d/5-install

View File

@@ -3,7 +3,7 @@
- name: Reload udev - name: Reload udev
ansible.builtin.command: ansible.builtin.command:
cmd: "{{ item }}" cmd: "{{ item }}"
changed_when: false changed_when: true
loop: loop:
- udevadm control --reload-rules - udevadm control --reload-rules
- udevadm trigger - udevadm trigger

View File

@@ -1,6 +1,6 @@
--- ---
- name: USB Udev rules - name: Put usb udev rules
ansible.builtin.copy: ansible.builtin.copy:
src: files/50-usb.rules src: files/50-usb.rules
dest: /etc/udev/rules.d/50-usb.rules dest: /etc/udev/rules.d/50-usb.rules

View File

@@ -1,6 +1,6 @@
--- ---
- name: Crontab for matomo - name: Cron for matomo
ansible.builtin.cron: ansible.builtin.cron:
name: Matomo reports name: Matomo reports
user: www-data user: www-data

View File

@@ -8,7 +8,7 @@
group: www-data group: www-data
mode: 0750 mode: 0750
- name: Create scootaloo config dir - name: Create scootaloo configuration dir
ansible.builtin.file: ansible.builtin.file:
path: "{{ scootaloo_db_path }}" path: "{{ scootaloo_db_path }}"
state: directory state: directory

View File

@@ -1,6 +1,6 @@
--- ---
- name: Put configuration file - name: Put scootaloo configuration file
ansible.builtin.template: ansible.builtin.template:
src: scootaloo.toml.j2 src: scootaloo.toml.j2
dest: /usr/local/etc/scootaloo.toml dest: /usr/local/etc/scootaloo.toml

View File

@@ -1,6 +1,11 @@
--- ---
- name: Systemd file for backend - name: Install git
ansible.builtin.package:
name: git
state: present
- name: Put systemd file for backend
ansible.builtin.copy: ansible.builtin.copy:
src: files/ttrss_backend.service src: files/ttrss_backend.service
dest: /etc/systemd/system/ttrss_backend.service dest: /etc/systemd/system/ttrss_backend.service
@@ -11,8 +16,3 @@
name: ttrss_backend name: ttrss_backend
enabled: true enabled: true
state: started state: started
- name: Install git
ansible.builtin.package:
name: git
state: present

View File

@@ -1,6 +1,6 @@
--- ---
- name: Nginx cache - name: Put nginx cache configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: files/fastcgi_cache.conf src: files/fastcgi_cache.conf
dest: /etc/nginx/conf.d/fastcgi_cache.conf dest: /etc/nginx/conf.d/fastcgi_cache.conf
@@ -8,7 +8,7 @@
notify: notify:
- Restart nginx - Restart nginx
- name: Wordpress cron - name: Cron for wordpress
ansible.builtin.cron: ansible.builtin.cron:
name: "WP Twitter refresh" name: "WP Twitter refresh"
user: www-data user: www-data

View File

@@ -13,14 +13,14 @@
cmd: /usr/bin/openssl dhparam -out /etc/prosody/certs/dh-2048.pem 2048 cmd: /usr/bin/openssl dhparam -out /etc/prosody/certs/dh-2048.pem 2048
creates: /etc/prosody/certs/dh-2048.pem creates: /etc/prosody/certs/dh-2048.pem
- name: Right management for dh params - name: Put rights dhparam
ansible.builtin.file: ansible.builtin.file:
path: /etc/prosody/certs/dh-2048.pem path: /etc/prosody/certs/dh-2048.pem
owner: root owner: root
group: prosody group: prosody
mode: '0640' mode: '0640'
- name: Prosody configuration files - name: Put prosody configuration file
ansible.builtin.copy: ansible.builtin.copy:
src: ./files/prosody.cfg.lua src: ./files/prosody.cfg.lua
dest: /etc/prosody/prosody.cfg.lua dest: /etc/prosody/prosody.cfg.lua