Compare commits
No commits in common. "9029a21de4ddd904b3cba5aee654124f34dbe9e4" and "96d4c79bedb8bdf745b6cf33e1e5bf125116b55a" have entirely different histories.
9029a21de4
...
96d4c79bed
|
@ -1,6 +0,0 @@
|
||||||
.venv/
|
|
||||||
*.code-workspace
|
|
||||||
*password*
|
|
||||||
host_vars/*/
|
|
||||||
docs/*.html
|
|
||||||
docs/*.pdf
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"recommendations": [
|
|
||||||
"redhat.ansible",
|
|
||||||
"asciidoctor.asciidoctor-vscode",
|
|
||||||
"streetsidesoftware.code-spell-checker",
|
|
||||||
"mhutchie.git-graph",
|
|
||||||
"esbenp.prettier-vscode",
|
|
||||||
"redhat.vscode-yaml"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -34,7 +34,7 @@ Requirements
|
||||||
```
|
```
|
||||||
- The `asciidoctor-pdf` (asciidoctor + pdf conversion), `rouge` (syntax highlighting) and `rghost` (pdf optimization) gem
|
- The `asciidoctor-pdf` (asciidoctor + pdf conversion), `rouge` (syntax highlighting) and `rghost` (pdf optimization) gem
|
||||||
```bash
|
```bash
|
||||||
gem install asciidoctor-pdf rouge rghost # you might have to run with 'sudo'
|
gem install asciidoctor-pdf rouge rghost
|
||||||
```
|
```
|
||||||
|
|
||||||
Then compile the guide:
|
Then compile the guide:
|
||||||
|
|
|
@ -27,6 +27,7 @@ qgis_repo:
|
||||||
postgresql_server:
|
postgresql_server:
|
||||||
port: 5432
|
port: 5432
|
||||||
user: # TODO: add option to change?
|
user: # TODO: add option to change?
|
||||||
|
password: # TODO: link to vault?
|
||||||
|
|
||||||
qgis_server:
|
qgis_server:
|
||||||
full_version: "1:{{ _qgis_server_version }}+17bookworm"
|
full_version: "1:{{ _qgis_server_version }}+17bookworm"
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Ensure custom motd is latest
|
- name: Ensure custom motd is latest
|
||||||
|
tags: debug
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: ./templates/motd.sh.j2
|
src: ./templates/motd.sh.j2
|
||||||
|
@ -218,18 +219,20 @@
|
||||||
- name: Check if lizmap-web-client is present
|
- name: Check if lizmap-web-client is present
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ lizmap['path'] }}lizmap-web-client-{{ _lizmap_version }}/VERSION"
|
path: "/var/www/lizmap-web-client-{{ _lizmap_version }}/VERSION"
|
||||||
register: _lizmap_version_stat
|
register: _lizmap_version_stat
|
||||||
|
|
||||||
- name: Check if lizmap-web-client has version information
|
- name: Check if lizmap-web-client is target version
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.slurp:
|
ansible.builtin.slurp:
|
||||||
src: "{{ lizmap['path'] }}lizmap-web-client-{{ _lizmap_version }}/VERSION"
|
src: "/var/www/lizmap-web-client-{{ _lizmap_version }}/VERSION"
|
||||||
when: _lizmap_version_stat.stat.exists
|
|
||||||
register: _lizmap_version_file
|
register: _lizmap_version_file
|
||||||
|
when: _lizmap_version_stat.stat.exists
|
||||||
|
|
||||||
- name: Check if lizmap-web-client must be installed
|
- name: Ensure lizmap-web-client is target version
|
||||||
when: "not _lizmap_version_stat.stat.exists"
|
when:
|
||||||
|
"(not _lizmap_version_stat.stat.exists) or (_lizmap_version_file is defined and
|
||||||
|
_lizmap_version_file['content'] | b64decode != lizmap['version'] + '\n')"
|
||||||
block:
|
block:
|
||||||
- name: Ensure lizmap-web-client is downloaded
|
- name: Ensure lizmap-web-client is downloaded
|
||||||
become: true
|
become: true
|
||||||
|
@ -247,16 +250,26 @@
|
||||||
src: "/tmp/lizmap-web-client-{{ lizmap['version'] }}.zip"
|
src: "/tmp/lizmap-web-client-{{ lizmap['version'] }}.zip"
|
||||||
dest: "{{ lizmap['path'] }}"
|
dest: "{{ lizmap['path'] }}"
|
||||||
owner: www-data
|
owner: www-data
|
||||||
mode: u=rwX,g=rX,o=r
|
mode: u=rw,g=r,o=r
|
||||||
register: _lizmap_extracted
|
register: _lizmap_extracted
|
||||||
|
|
||||||
- name: Ensure lizmap-web-client is symlinked to documentRoot
|
- name: Ensure lizmap-web-client is symlinked to documentRoot
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
src: "{{ lizmap['path'] }}lizmap-web-client-{{ _lizmap_version }}/lizmap/www"
|
src: "/var/www/lizmap-web-client-{{ _lizmap_version }}/lizmap/www"
|
||||||
dest: "/var/www/html/lizmap"
|
dest: "/var/www/html/lizmap"
|
||||||
state: link
|
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
|
- name: Ensure lizmap-web-client conf is latest
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
|
@ -268,11 +281,14 @@
|
||||||
mode: u=rw,g=r,o=
|
mode: u=rw,g=r,o=
|
||||||
create: true
|
create: true
|
||||||
marker: "; {mark} ANSIBLE MANAGED BLOCK"
|
marker: "; {mark} ANSIBLE MANAGED BLOCK"
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
- profiles.ini.php
|
- profiles.ini.php
|
||||||
- lizmapConfig.ini.php
|
- lizmapConfig.ini.php
|
||||||
- localconfig.ini.php
|
- localconfig.ini.php
|
||||||
|
|
||||||
|
register: _lizmap_conf
|
||||||
|
|
||||||
- name: Ensure lizmap-web-client directory has correct rights and owner
|
- name: Ensure lizmap-web-client directory has correct rights and owner
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
@ -295,36 +311,21 @@
|
||||||
- lizmap/www/cache/
|
- lizmap/www/cache/
|
||||||
- lizmap/www/document/
|
- lizmap/www/document/
|
||||||
- lizmap/www/live/
|
- lizmap/www/live/
|
||||||
|
register: _lizmap_rights
|
||||||
|
|
||||||
- name: Ensure lizmap-web-client installer was executed # noqa: no-handler
|
- name: Ensure lizmap-web-client installer was executed
|
||||||
when:
|
|
||||||
"_lizmap_extracted is changed"
|
|
||||||
# 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: true
|
||||||
become_user: www-data # TODO: ignore warning for remote_tmp
|
become_user: www-data # TODO: ignore warning for remote_tmp
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
chdir: "{{ lizmap['path'] }}lizmap-web-client-{{ lizmap['version'] }}"
|
chdir: "{{ lizmap['path'] }}lizmap-web-client-{{ lizmap['version'] }}"
|
||||||
cmd: "php lizmap/install/installer.php"
|
cmd: "php lizmap/install/installer.php"
|
||||||
|
when:
|
||||||
|
"(_lizmap_extracted is changed)
|
||||||
|
or (_lizmap_conf is changed)
|
||||||
|
or (_lizmap_rights is changed)"
|
||||||
|
# TODO: find actual changes
|
||||||
changed_when: true # TODO: find actual changes
|
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
|
- name: Ensure nginx sites are valid
|
||||||
notify:
|
notify:
|
||||||
- "Ensure nginx is restarted"
|
- "Ensure nginx is restarted"
|
||||||
|
|
Loading…
Reference in New Issue