sympa-community / sympa-ansible Goto Github PK
View Code? Open in Web Editor NEWGeneric install of Sympa with Ansible
Generic install of Sympa with Ansible
TASK [common : Add user accounts] *************************************************************************************************************************************************
ok: [local-sympa] => (item={'name': 'david', 'password': False, 'group': 'sympa'})
ok: [local-sympa] => (item={'name': 'olivier', 'password': False, 'group': 'sympa'})
[WARNING]: The input password appears not to have been hashed. The 'password' argument must be encrypted for this module to work properly.
This setup is described here:
https://nileshgr.com/2016/07/09/systemd-fastcgi-multiple-processes
TASK [sympa : Upgrade Sympa] ***********************************************************************************************************************************
fatal: [local-sympa-ubuntu16]: FAILED! => {"changed": true, "cmd": "/usr/local/sympa/bin/sympa.pl --upgrade", "delta": "0:00:00.586450", "end": "2017-12-13 12:02:04.872614", "failed": true, "msg": "non-zero return code", "rc": 255, "start": "2017-12-13 12:02:04.286164", "stderr": "err main::#251 > main::_load#981 > Sympa::DatabaseManager::instance#54 > Sympa::DatabaseDriver::MySQL::connect#53 > Sympa::Database::connect#158 Can't connect to Database Sympa::DatabaseDriver::MySQL <db_host=localhost;db_name=sympa;db_user=sympa_user>: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)\nDatabase sympa defined in sympa.conf is unreachable. verify db_xxx parameters in sympa.conf", "stderr_lines": ["err main::#251 > main::_load#981 > Sympa::DatabaseManager::instance#54 > Sympa::DatabaseDriver::MySQL::connect#53 > Sympa::Database::connect#158 Can't connect to Database Sympa::DatabaseDriver::MySQL <db_host=localhost;db_name=sympa;db_user=sympa_user>: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)", "Database sympa defined in sympa.conf is unreachable. verify db_xxx parameters in sympa.conf"], "stdout": "", "stdout_lines": []}
Proof of concept below:
CWD=`pwd`
SCRIPT_DIR=`dirname $0`
ANSIBLE_DIR="$SCRIPT_DIR/.."
INVENTORY_DIR="environments/local"
INVENTORY_PATH="$ANSIBLE_DIR/$INVENTORY_DIR"
echo $ANSIBLE_DIR
echo $INVENTORY_PATH
# check whether inventory exists
if [ -d "$INVENTORY_PATH" ]; then
echo "Inventory directory $INVENTORY_DIR exists already, terminating."
exit 1
fi
$SCRIPT_DIR/create_new_environment.sh $INVENTORY_PATH
# setup inventory file
ln -s ../../.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory $INVENTORY_PATH/inventory
This can be done with the sympa --create_list
command.
Please document the custom plugins in the filter_plugins and action_plugins directories. It is not obvious where these filters come from when looking at the task files.
E.g.:
For a possible solution see: ansible/ansible#61621
TASK [Create secrets] **********************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named json
fatal: [localhost -> 127.0.0.1]: FAILED! => changed=false
module_stderr: |-
Traceback (most recent call last):
File "/home/travis/.ansible/tmp/ansible-tmp-1574069964.2-143565745060280/AnsiballZ_vault_random.py", line 102, in <module>
_ansiballz_main()
File "/home/travis/.ansible/tmp/ansible-tmp-1574069964.2-143565745060280/AnsiballZ_vault_random.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/travis/.ansible/tmp/ansible-tmp-1574069964.2-143565745060280/AnsiballZ_vault_random.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible.modules.vault_random', init_globals=None, run_name='__main__', alter_sys=True)
File "/usr/lib/python2.7/runpy.py", line 188, in run_module
fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/tmp/ansible_vault_random_payload_EBOVLE/ansible_vault_random_payload.zip/ansible/modules/vault_random.py", line 14, in <module>
File "/usr/lib/python2.7/dist-packages/ansible/cli/__init__.py", line 22, in <module>
from ansible.inventory.manager import InventoryManager
File "/usr/lib/python2.7/dist-packages/ansible/inventory/manager.py", line 38, in <module>
from ansible.plugins.loader import inventory_loader
File "/usr/lib/python2.7/dist-packages/ansible/plugins/loader.py", line 22, in <module>
from ansible.parsing.utils.yaml import from_yaml
File "/usr/lib/python2.7/dist-packages/ansible/parsing/utils/yaml.py", line 19, in <module>
from ansible.parsing.ajson import AnsibleJSONDecoder
File "/usr/lib/python2.7/dist-packages/ansible/parsing/ajson.py", line 11, in <module>
from ansible.module_utils.common.json import AnsibleJSONEncoder
ImportError: No module named json
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1
This directory contains the secrets for the SSL keys, so it should definitely not world readable.
There is a large section about "Ansible Tools" in the README which addresses more advance users but nothing at all about the other servers (web/database/email).
[DEPRECATION WARNING]: Distribution Ubuntu 16.04 on host local-sympa should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with prior
Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information. This feature will be removed in version 2.12. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
After installing sympa ansible and followed the instructions of the wiki[0].
The content directory in /home/sympa/ is empty.
It is certainly possible to use standard Ansible vault for encryption of single variables in a YAML file despite the claim on https://github.com/sympa-community/sympa-ansible#encrypting-secrets. So we could make the encryption of these variables the default, especially as we generate the environment.
This happens when you run the playbook as instructed.
TASK [sympa : include_vars] ***************************************************************************************************************************************
fatal: [local-sympa-ubuntu16]: FAILED! => {"ansible_facts": {"robots": {}}, "ansible_included_var_files": [], "changed": false, "message": "/home/racke/sympa-community/ansible/environments/local/sympa_virtual_robots directory does not exist"}
No idea how that happened. @dverdin where is the vault filter documented?
b'-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTNOr78A4OLU51\nJZgep+AcSphIw80NqXUTKmncUCP4Vexkzds1OBvpDiDX43KfXidPxV1m4FmiatP7\nBepulwiNYS6P0Do9ZaCV+oYwfDUSCiKcyJxfnwUXJKOCGP2iAPpp4E/qd+h8EtNH\nIqde/thyxZ5YzlbkJ/+axcENacPH/TyGWWr25itzagj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mxqhPXxk21bGD2FWFcqATqnVa4ed9mbjF31v4ACFE6ocDozbusx\nxxMy/zs3UTh+PBOEBDBUx/KDs5/sWw2ldPR/6c2jJmAJxxsuS+OX0xDlwzjs4WbW\nX16Q6va4PRYYar2No/hfOvjUYraHvSTBft/FlB5lAoGBAKq9wS5fzhPbuKtDlvNc\n+9F8FggpH7FPTVOVIeMKNa/UhdBR22XB0XQYc/e6wGhE7EpThXe73bg3lRCGDI5Q\nV85co4XgClR1X3moGc5abxpgFwAfju7+gbxhuegqErQXvctubNCdkPPhRgbdESNZ\nprJ1WMeWkm5hFDG8r9k/+++y\n-----END PRIVATE KEY-----\n
I suppose that most Sympa instances don't use the SOAP server, thus I would like to make the SOAP server optional through a variable.
Currently we have basically a big Sympa role that installs database, postfix, apache and sympa. Each one of these should become its own role. Also they should be executed in a more logical order:
That would allow more flexibility as well, e.g. leaving out roles or replace with a different server (nginx, exim).
Should allow using remote LDAP server and local OpenLDAP server (installed from a role).
Nov 8 16:31:42 local-sympa-ubuntu16 wwsympa[15808]: err main::#997 > Conf::data_structure_uptodate#741 Data structure (6.2.16) is not uptodate for current release (6.2.22)
Nov 8 16:31:42 local-sympa-ubuntu16 wwsympa[15808]: err main::#999 WWSympa set to maintenance mode; you should run sympa.pl --upgrade
configure: WARNING: unrecognized options: --with-unitsdir\nconfigure: WARNING: unrecognized options: --with-unitsdir\nqueue.c: In function 'main':\nqueue.c:119:8: warning: implicit declaration of function 'chdir' [-Wimplicit-function-declaration]\n if (chdir(queuedir) == -1) {\n ^\nqueue.c:125:4: warning: implicit declaration of function 'umask' [-Wimplicit-function-declaration]\n umask(027);\n ^\nqueue.c:126:60: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration]\n snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());\n ^\nqueue.c:126:72: warning: implicit declaration of function 'getpid' [-Wimplicit-function-declaration]\n snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());\n ^\nqueue.c:126:35: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]\n snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());\n ^\nqueue.c:126:35: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]\nqueue.c:134:4: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]\n write(fd, \"X-Sympa-To: \", 12);\n ^\nqueue.c:145:16: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]\n while ((i = read(fileno(stdin), buf, sizeof buf)) > 0)\n ^\nqueue.c:146:4: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]\n close(fd);\n ^\nqueue.c:148:4: warning: implicit declaration of function 'sleep' [-Wimplicit-function-declaration]\n sleep(1);\n ^\nbouncequeue.c: In function 'main':\nbouncequeue.c:103:8: warning: implicit declaration of function 'chdir' [-Wimplicit-function-declaration]\n if (chdir(bouncedir) == -1) {\n ^\nbouncequeue.c:106:4: warning: implicit declaration of function 'umask' [-Wimplicit-function-declaration]\n umask(027);\n ^\nbouncequeue.c:107:60: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration]\n snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());\n ^\nbouncequeue.c:107:72: warning: implicit declaration of function 'getpid' [-Wimplicit-function-declaration]\n snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());\n ^\nbouncequeue.c:107:35: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]\n snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());\n ^\nbouncequeue.c:107:35: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]\nbouncequeue.c:111:4: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]\n write(fd, \"X-Sympa-To: \", 12);\n ^\nbouncequeue.c:122:16: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]\n while ((i = read(fileno(stdin), buf, sizeof buf)) > 0)\n ^\nbouncequeue.c:123:4: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]\n close(fd);\n ^\nbouncequeue.c:125:4: warning: implicit declaration of function 'sleep' [-Wimplicit-function-declaration]\n sleep(1);\n ^\nfamilyqueue.c: In function 'main':\nfamilyqueue.c:114:8: warning: implicit declaration of function 'chdir' [-Wimplicit-function-declaration]\n if (chdir(queuedir) == -1) {\n ^\nfamilyqueue.c:120:4: warning: implicit declaration of function 'umask' [-Wimplicit-function-declaration]\n umask(027);\n ^\nfamilyqueue.c:121:60: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration]\n snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());\n ^\nfamilyqueue.c:121:72: warning: implicit declaration of function 'getpid' [-Wimplicit-function-declaration]\n snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());\n ^\nfamilyqueue.c:121:35: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]\n snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());\n ^\nfamilyqueue.c:121:35: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]\nfamilyqueue.c:129:4: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]\n write(fd, \"X-Sympa-Family: \", 16);\n ^\nfamilyqueue.c:144:16: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]\n while ((i = read(fileno(stdin), buf, sizeof buf)) > 0)\n ^\nfamilyqueue.c:145:4: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]\n close(fd);\n ^\nfamilyqueue.c:147:4: warning: implicit declaration of function 'sleep' [-Wimplicit-function-declaration]\n sleep(1);\n ^\naliaswrapper.c: In function 'main':\naliaswrapper.c:38:2: warning: ignoring return value of 'setuid', declared with attribute warn_unused_result [-Wunused-result]\n setuid(0);\n ^\nvirtualwrapper.c: In function 'main':\nvirtualwrapper.c:37:2: warning: ignoring return value of 'setuid', declared with attribute warn_unused_result [-Wunused-result]\n setuid(0);\n ^\nwwsympa-wrapper.fcgi.c: In function 'main':\nwwsympa-wrapper.fcgi.c:4:5: warning: ignoring return value of 'setreuid', declared with attribute warn_unused_result [-Wunused-result]\n setreuid(geteuid(),geteuid()); // Added to fix the segfault\n ^\nwwsympa-wrapper.fcgi.c:5:5: warning: ignoring return value of 'setregid', declared with attribute warn_unused_result [-Wunused-result]\n setregid(getegid(),getegid()); // Added to fix the segfault\n ^\nsympa_soap_server-wrapper.fcgi.c: In function 'main':\nsympa_soap_server-wrapper.fcgi.c:4:5: warning: ignoring return value of 'setreuid', declared with attribute warn_unused_result [-Wunused-result]\n setreuid(geteuid(),geteuid());\n ^\nsympa_soap_server-wrapper.fcgi.c:5:5: warning: ignoring return value of 'setregid', declared with attribute warn_unused_result [-Wunused-result]\n setregid(getegid(),getegid());\n ^\narchived.pod around line 61: Non-ASCII character seen before =encoding in 'Comité'. Assuming ISO8859-1\nPOD document had syntax errors at /usr/bin/pod2man line 68.\nmake[2]: *** [archived.8] Error 255\nmake[1]: *** [all-recursive] Error 1\nmake: *** [all-recursive] Error 1", "stderr_lines": ["configure: WARNING: unrecognized options: --with-unitsdir", "configure: WARNING: unrecognized options: --with-unitsdir", "queue.c: In function 'main':", "queue.c:119:8: warning: implicit declaration of function 'chdir' [-Wimplicit-function-declaration]", " if (chdir(queuedir) == -1) {", " ^", "queue.c:125:4: warning: implicit declaration of function 'umask' [-Wimplicit-function-declaration]", " umask(027);", " ^", "queue.c:126:60: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration]", " snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());", " ^", "queue.c:126:72: warning: implicit declaration of function 'getpid' [-Wimplicit-function-declaration]", " snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());", " ^", "queue.c:126:35: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]", " snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());", " ^", "queue.c:126:35: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]", "queue.c:134:4: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]", " write(fd, \"X-Sympa-To: \", 12);", " ^", "queue.c:145:16: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]", " while ((i = read(fileno(stdin), buf, sizeof buf)) > 0)", " ^", "queue.c:146:4: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]", " close(fd);", " ^", "queue.c:148:4: warning: implicit declaration of function 'sleep' [-Wimplicit-function-declaration]", " sleep(1);", " ^", "bouncequeue.c: In function 'main':", "bouncequeue.c:103:8: warning: implicit declaration of function 'chdir' [-Wimplicit-function-declaration]", " if (chdir(bouncedir) == -1) {", " ^", "bouncequeue.c:106:4: warning: implicit declaration of function 'umask' [-Wimplicit-function-declaration]", " umask(027);", " ^", "bouncequeue.c:107:60: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration]", " snprintf(qfile, sizeof(qfile), \"T.%s.%ld.%d\", listname, time(NULL), getpid());"
Hi,
Ansible installs /etc/mail/sympa_aliases including : bounce+*: "| /usr/local/sympa/bin/bouncequeue [email protected]"
. On my local server delivery to bounce+* fails with the following error :
May 27 21:07:06 localhost postfix/local[6077]: 0424BA23A6: to=<[email protected]>, relay=local, delay=1.9, delays=1.9/0.01/0/0, dsn=5.1.1, status=bounced (unknown user: "bounce")
I tried applying the recommended change on /etc/postfix/master.cf
from http://cweiske.de/tagebuch/postfix-plus-addressing.htm but still mails to bounce+* are rejected.
Any clue to fix that?
Shouldn't there be more repositories that install a sympa server? And not the complete ansible inventory?
I was wondering if there would be the possibility to split this repository into multiple repositories to allow further development and reusage for small parts.
I would be interested to extend the sympa role, but not with apache and since we use our own common role, I would think I would be a great help putting the sympa role into its own repository and listing the dependencies or the requirements for this role to work.
What do you guys think?
[DEPRECATION WARNING]: The module is using the PyOpenSSL backend. This backend has been deprecated. This feature will be removed in version 2.13. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
Old download on sympa.org is not up-to-date as discussed on IRC - newer releases are missing there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.