Compare commits

...

2 Commits

6 changed files with 52 additions and 38 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.venv/
*.code-workspace
*password*
host_vars/*/
docs/*.html
docs/*.pdf

10
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,10 @@
{
"recommendations": [
"redhat.ansible",
"asciidoctor.asciidoctor-vscode",
"streetsidesoftware.code-spell-checker",
"mhutchie.git-graph",
"esbenp.prettier-vscode",
"redhat.vscode-yaml"
]
}

View File

@ -34,7 +34,7 @@ Requirements
```
- The `asciidoctor-pdf` (asciidoctor + pdf conversion), `rouge` (syntax highlighting) and `rghost` (pdf optimization) gem
```bash
gem install asciidoctor-pdf rouge rghost
gem install asciidoctor-pdf rouge rghost # you might have to run with 'sudo'
```
Then compile the guide:

View File

@ -52,7 +52,7 @@ ansible-galaxy install -r requirements.yaml
. Set hostname used by ansible `export NEW_ANSIBLE_HOST="test-host"`
. Set username used by ansible `export NEW_ANSIBLE_USER="manager"`
.
.
+
[,bash]
----

View File

@ -27,7 +27,6 @@ qgis_repo:
postgresql_server:
port: 5432
user: # TODO: add option to change?
password: # TODO: link to vault?
qgis_server:
full_version: "1:{{ _qgis_server_version }}+17bookworm"

View File

@ -36,7 +36,6 @@
tasks:
- name: Ensure custom motd is latest
tags: debug
become: true
ansible.builtin.template:
src: ./templates/motd.sh.j2
@ -219,20 +218,18 @@
- name: Check if lizmap-web-client is present
become: true
ansible.builtin.stat:
path: "/var/www/lizmap-web-client-{{ _lizmap_version }}/VERSION"
path: "{{ lizmap['path'] }}lizmap-web-client-{{ _lizmap_version }}/VERSION"
register: _lizmap_version_stat
- name: Check if lizmap-web-client is target version
- name: Check if lizmap-web-client has version information
become: true
ansible.builtin.slurp:
src: "/var/www/lizmap-web-client-{{ _lizmap_version }}/VERSION"
register: _lizmap_version_file
src: "{{ lizmap['path'] }}lizmap-web-client-{{ _lizmap_version }}/VERSION"
when: _lizmap_version_stat.stat.exists
register: _lizmap_version_file
- name: Ensure lizmap-web-client is target version
when:
"(not _lizmap_version_stat.stat.exists) or (_lizmap_version_file is defined and
_lizmap_version_file['content'] | b64decode != lizmap['version'] + '\n')"
- name: Check if lizmap-web-client must be installed
when: "not _lizmap_version_stat.stat.exists"
block:
- name: Ensure lizmap-web-client is downloaded
become: true
@ -250,26 +247,16 @@
src: "/tmp/lizmap-web-client-{{ lizmap['version'] }}.zip"
dest: "{{ lizmap['path'] }}"
owner: www-data
mode: u=rw,g=r,o=r
mode: u=rwX,g=rX,o=r
register: _lizmap_extracted
- name: Ensure lizmap-web-client is symlinked to documentRoot
become: true
ansible.builtin.file:
src: "/var/www/lizmap-web-client-{{ _lizmap_version }}/lizmap/www"
src: "{{ lizmap['path'] }}lizmap-web-client-{{ _lizmap_version }}/lizmap/www"
dest: "/var/www/html/lizmap"
state: link
- name: Ensure lizmap-web-client default users file is latest
become: true
ansible.builtin.template:
src: "./templates/lizmap/defaultusers.json.j2"
dest: "{{ lizmap['path'] }}lizmap-web-client-{{ lizmap['version'] }}/lizmap/modules/lizmap/install/defaultusers.json"
backup: true
owner: www-data
group: www-data
mode: u=rw,g=r,o=
- name: Ensure lizmap-web-client conf is latest
become: true
ansible.builtin.blockinfile:
@ -281,14 +268,11 @@
mode: u=rw,g=r,o=
create: true
marker: "; {mark} ANSIBLE MANAGED BLOCK"
loop:
- profiles.ini.php
- lizmapConfig.ini.php
- localconfig.ini.php
register: _lizmap_conf
- name: Ensure lizmap-web-client directory has correct rights and owner
become: true
ansible.builtin.file:
@ -311,20 +295,35 @@
- lizmap/www/cache/
- lizmap/www/document/
- lizmap/www/live/
register: _lizmap_rights
- name: Ensure lizmap-web-client installer was executed
become: true
become_user: www-data # TODO: ignore warning for remote_tmp
ansible.builtin.command:
chdir: "{{ lizmap['path'] }}lizmap-web-client-{{ lizmap['version'] }}"
cmd: "php lizmap/install/installer.php"
- name: Ensure lizmap-web-client installer was executed # noqa: no-handler
when:
"(_lizmap_extracted is changed)
or (_lizmap_conf is changed)
or (_lizmap_rights is changed)"
"_lizmap_extracted is changed"
# TODO: find actual changes
changed_when: true # TODO: find actual changes
block:
- name: Ensure lizmap-web-client default users file is latest
become: true
ansible.builtin.template:
src: "./templates/lizmap/defaultusers.json.j2"
dest: "{{ lizmap['path'] }}lizmap-web-client-{{ lizmap['version'] }}/lizmap/modules/lizmap/install/defaultusers.json"
backup: false
owner: www-data
group: www-data
mode: u=rw,g=r,o=
- name: Run lizmap-web-client installer
become: true
become_user: www-data # TODO: ignore warning for remote_tmp
ansible.builtin.command:
chdir: "{{ lizmap['path'] }}lizmap-web-client-{{ lizmap['version'] }}"
cmd: "php lizmap/install/installer.php"
changed_when: true # TODO: find actual changes
- name: Ensure lizmap-web-client default users file is removed
become: true
ansible.builtin.file:
path: "{{ lizmap['path'] }}lizmap-web-client-{{ lizmap['version'] }}/lizmap/modules/lizmap/install/defaultusers.json"
state: absent
- name: Ensure nginx sites are valid
notify: