summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2022-10-11 16:05:48 +0200
committerGuilhem Moulin <guilhem@fripost.org>2022-10-11 20:03:03 +0200
commiteeadb037937ee1b5da6e084b98acb8f9c3242e2f (patch)
tree2bbf6687122d8cc0938bec1a4570c362047bdc80 /roles
parent9c67e4f8e539638a6621803c3c18ce5723fbdcc6 (diff)
Remove module ‘mysql_user2’.
These days upstream's ‘mysql_user’ is good enough.
Diffstat (limited to 'roles')
-rw-r--r--roles/IMAP/tasks/spam.yml4
-rw-r--r--roles/bacula-dir/tasks/main.yml4
-rw-r--r--roles/common-SQL/tasks/main.yml10
-rw-r--r--roles/lists/tasks/sympa.yml4
4 files changed, 11 insertions, 11 deletions
diff --git a/roles/IMAP/tasks/spam.yml b/roles/IMAP/tasks/spam.yml
index c275b55..d70ccc9 100644
--- a/roles/IMAP/tasks/spam.yml
+++ b/roles/IMAP/tasks/spam.yml
@@ -46,38 +46,38 @@
mode=0644
with_items:
- spamassassin/local.cf
register: r2
notify:
- Restart Amavis
- name: Provision /etc/default/spamassassin
lineinfile: dest=/etc/default/spamassassin
regexp='^(\\s*#)?\\s*{{ item.var }}\\s*='
line='{{ item.var }}={{ item.value }}'
owner=root group=root
mode=0644
with_items:
- { var: ENABLED, value: 0 }
- { var: CRON, value: 1 }
- name: Create a 'amavis' SQL user
# This *must* be the user we run spamd as
# See https://svn.apache.org/repos/asf/spamassassin/trunk/sql/README.bayes
- mysql_user2: >
- name=amavis password= auth_plugin=auth_socket
+ mysql_user: >
+ name=amavis password= plugin=auth_socket
priv="spamassassin.awl: SELECT,INSERT,UPDATE,DELETE
/spamassassin.bayes_seen: SELECT,INSERT, DELETE
/spamassassin.bayes_token: SELECT,INSERT,UPDATE,DELETE
/spamassassin.bayes_global_vars: SELECT
/spamassassin.bayes_vars: SELECT,INSERT,UPDATE,DELETE
/spamassassin.bayes_expire: SELECT,INSERT, DELETE"
state=present
register: r3
notify:
- Restart Amavis
- name: Start Amavis
service: name=amavis state=started
when: not (r1.changed or r2.changed or r3.changed)
- meta: flush_handlers
diff --git a/roles/bacula-dir/tasks/main.yml b/roles/bacula-dir/tasks/main.yml
index 2fdb35b..53d44ee 100644
--- a/roles/bacula-dir/tasks/main.yml
+++ b/roles/bacula-dir/tasks/main.yml
@@ -1,31 +1,31 @@
- name: Install bacula-director
apt: pkg={{ packages }}
vars:
packages:
- bacula-console
- bacula-director
- bacula-director-mysql
- name: Create a 'bacula' SQL user
- mysql_user2: name=bacula password= auth_plugin=unix_socket
- state=present
+ mysql_user: name=bacula password= plugin=unix_socket
+ state=present
notify:
- Restart bacula-director
# Populate with:
# echo bconsole $(pwgen -sn 64 1) | sudo tee -a /etc/bacula/passwords-dir
# echo $sd-sd $(pwgen -sn 64 1) | sudo tee -a /etc/bacula/passwords-dir
# echo $fd-fd $(pwgen -sn 64 1) | sudo tee -a /etc/bacula/passwords-dir
#
# then add the password for each FD / SD:
# echo $director-dir $password | sudo tee /etc/bacula/passwords-sd
# echo $director-dir $password | sudo tee /etc/bacula/passwords-fd
- name: Ensure /etc/bacula/passwords-dir exists
file: path=/etc/bacula/passwords-dir
state=file
owner=bacula group=bacula
mode=0600
- name: Configure bconsole
template: src=etc/bacula/bconsole.conf.j2
dest=/etc/bacula/bconsole.conf
diff --git a/roles/common-SQL/tasks/main.yml b/roles/common-SQL/tasks/main.yml
index 927f567..7e59f60 100644
--- a/roles/common-SQL/tasks/main.yml
+++ b/roles/common-SQL/tasks/main.yml
@@ -1,51 +1,51 @@
- name: Install MariaDB
apt: pkg={{ packages }}
vars:
packages:
- mariadb-common
- mariadb-server
- - python-mysqldb
+ - python3-mysqldb
# for the 'mysql_' munin plugin
- libcache-cache-perl
- name: Copy MySQL/MariaDB configuration
copy: src=etc/mysql/mariadb.conf.d/99-user.cnf
dest=/etc/mysql/mariadb.conf.d/99-user.cnf
owner=root group=root
mode=0644
register: r
notify:
- Restart MariaDB
# We need to restart now and load the relevant authplugin before we
# connect to the database.
- meta: flush_handlers
# XXX Dirty fix for #742046
- name: Force root to use UNIX permissions
- mysql_user2: name=root password="" auth_plugin=unix_socket soname=auth_socket.so
- state=present
+ mysql_user: name=root password="" plugin=unix_socket
+ state=present
- name: Disallow anonymous and TCP/IP root login
- mysql_user2: name={{ item.name|default('') }} host={{ item.host }}
- state=absent
+ mysql_user: name={{ item.name|default('') }} host={{ item.host }}
+ state=absent
with_items:
- { host: '{{ inventory_hostname_short }}' }
- { host: 'localhost' }
- { host: '127.0.0.1'}
- { host: '::1'}
- { name: root, host: '{{ inventory_hostname_short }}' }
- { name: root, host: '127.0.0.1'}
- { name: root, host: '::1'}
- name: Start MariaDB
service: name=mariadb state=started
- name: Install 'mysql_' Munin wildcard plugin
file: src=/usr/share/munin/plugins/mysql_
dest=/etc/munin/plugins/mysql_{{ item }}
owner=root group=root
state=link force=yes
with_items:
# sudo /usr/share/munin/plugins/mysql_ suggest
diff --git a/roles/lists/tasks/sympa.yml b/roles/lists/tasks/sympa.yml
index 0d5eac1..27a5823 100644
--- a/roles/lists/tasks/sympa.yml
+++ b/roles/lists/tasks/sympa.yml
@@ -1,34 +1,34 @@
- apt: pkg={{ packages }} install_recommends=no
vars:
packages:
- mariadb-server
- sympa
- libnet-dns-perl
- libnet-dns-sec-perl
- libmail-dkim-perl
- libcrypt-smime-perl
- libcrypt-openssl-x509-perl
- name: Make the 'sympa' MySQL user use unix_socket
- mysql_user2: name=sympa password= auth_plugin=unix_socket
- state=present
+ mysql_user: name=sympa password= plugin=unix_socket
+ state=present
- name: Configure Sympa
copy: src=etc/sympa/{{ item }}
dest=/etc/sympa/{{ item }}
owner=root group=sympa
mode=0644
with_items:
- sympa/sympa.conf
- topics.conf
register: r1
notify:
- Restart Sympa
- name: Create Virtual hosts for Sympa (1)
file: path=/etc/sympa/{{ item }}
state=directory
owner=sympa group=sympa
mode=0755
with_items:
- lists.fripost.org