Rosa-Luxemburgstiftung-Berlin / rls.openproject

ansible playbook to install openproject on debian systems
0 stars 0 forks source link

implement molecule test #1

Closed zerwes closed 10 months ago

zerwes commented 10 months ago

molecule tests for debian/ubuntu using different ansible versions

zerwes commented 10 months ago

currently the task openproject configure fails in the docker env:

root@instance:/# openproject configure -f installer.dat 
Launching installer for openproject...
chown: warning: '.' should be ':': ‘openproject.openproject’
chown: warning: '.' should be ':': ‘openproject.openproject’
chown: warning: '.' should be ':': ‘openproject.openproject’
Selected addons: legacy-installer openproject-edition postgres apache2 repositories memcached openproject
[legacy-installer] ./bin/configure
[openproject-edition] ./bin/configure
DONE
[postgres] ./bin/configure
Postgres connection OK
DONE
[apache2] ./bin/configure
DONE
[repositories] ./bin/configure
DONE
[memcached] ./bin/configure
DONE
[openproject] ./bin/configure
DONE
[legacy-installer] ./bin/preinstall
[openproject-edition] ./bin/preinstall
[postgres] ./bin/preinstall
INFO: autoinstall=install. A new PostgreSQL v13 server will be installed locally unless a conflicting installation is found.
INFO: Checking whether port 45432 is available... OK (netstat not found)
INFO: Adding repository signing key from PostgreSQL... Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
INFO: Installing PostgreSQL v13...
W: https://apt.postgresql.org/pub/repos/apt/dists/bookworm-pgdg/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  postgresql-client-13 postgresql-client-common postgresql-common
Suggested packages:
  postgresql-doc-13
The following NEW packages will be installed:
  postgresql-13 postgresql-client-13 postgresql-client-common postgresql-common
0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded.
Need to get 17.2 MB of archives.
After this operation, 56.6 MB of additional disk space will be used.
Get:1 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 postgresql-client-common all 256.pgdg120+1 [36.4 kB]
Get:2 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 postgresql-common all 256.pgdg120+1 [181 kB]
Get:3 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 postgresql-client-13 amd64 13.13-1.pgdg120+1 [1,518 kB]
Get:4 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 postgresql-13 amd64 13.13-1.pgdg120+1 [15.5 MB]
Fetched 17.2 MB in 1s (24.7 MB/s)       
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package postgresql-client-common.
(Reading database ... 65226 files and directories currently installed.)
Preparing to unpack .../postgresql-client-common_256.pgdg120+1_all.deb ...
Unpacking postgresql-client-common (256.pgdg120+1) ...
Selecting previously unselected package postgresql-common.
Preparing to unpack .../postgresql-common_256.pgdg120+1_all.deb ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Unpacking postgresql-common (256.pgdg120+1) ...
Selecting previously unselected package postgresql-client-13.
Preparing to unpack .../postgresql-client-13_13.13-1.pgdg120+1_amd64.deb ...
Unpacking postgresql-client-13 (13.13-1.pgdg120+1) ...
Selecting previously unselected package postgresql-13.
Preparing to unpack .../postgresql-13_13.13-1.pgdg120+1_amd64.deb ...
Unpacking postgresql-13 (13.13-1.pgdg120+1) ...
Setting up postgresql-client-common (256.pgdg120+1) ...
Setting up postgresql-client-13 (13.13-1.pgdg120+1) ...
update-alternatives: using /usr/share/postgresql/13/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-common (256.pgdg120+1) ...

Creating config file /etc/postgresql-common/createcluster.conf with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
'/etc/apt/trusted.gpg.d/apt.postgresql.org.gpg' -> '/usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg'
invoke-rc.d: policy-rc.d denied execution of start.
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /lib/systemd/system/postgresql.service.
/usr/sbin/policy-rc.d returned 101, not running 'start postgresql.service'
Setting up postgresql-13 (13.13-1.pgdg120+1) ...
Creating new PostgreSQL cluster 13/main ...
/usr/lib/postgresql/13/bin/initdb -D /var/lib/postgresql/13/main --auth-local peer --auth-host md5
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "C.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/13/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

    pg_ctlcluster 13 main start

invoke-rc.d: policy-rc.d denied execution of start.
pg_ctl: PID file "/var/lib/postgresql/13/main/postmaster.pid" does not exist
Is server running?
pg_ctl: PID file "/var/lib/postgresql/13/main/postmaster.pid" does not exist
Is server running?
trying to start server anyway
pg_ctl: could not read file "/var/lib/postgresql/13/main/postmaster.opts"
zerwes commented 10 months ago

starting the service later seems to work without any problems:

root@instance:/# pg_ctlcluster 13 main start
root@instance:/# ls -l /var/lib/postgresql/13/main/postmaster.opts /var/lib/postgresql/13/main/postmaster.pid
-rw------- 1 postgres postgres 130 Nov 11 09:56 /var/lib/postgresql/13/main/postmaster.opts
-rw------- 1 postgres postgres 110 Nov 11 09:56 /var/lib/postgresql/13/main/postmaster.pid
zerwes commented 10 months ago

added RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d to the docker files seems to help ...

zerwes commented 10 months ago

done