collab: ansible-lint fixes

This commit is contained in:
Timo Makinen 2022-10-30 16:23:53 +00:00
parent 999026a8bc
commit 7c214a7792

View file

@ -1,14 +1,18 @@
--- ---
- name: add graphviz repository - name: Add graphviz repository
yum_repository: ansible.builtin.yum_repository:
name: graphviz name: graphviz
baseurl: "https://www2.graphviz.org/Packages/stable/centos/$releasever/os/x86_64/" baseurl: >
{{
"https://www2.graphviz.org" +
"/Packages/stable/centos/$releasever/os/$basearch/"
}}
description: Graphviz description: Graphviz
gpgcheck: false gpgcheck: false
enabled: true enabled: true
- name: install dependencies - name: Install dependencies
package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: installed state: installed
with_items: with_items:
@ -19,15 +23,14 @@
- python2-pip - python2-pip
- python2-setuptools - python2-setuptools
- name: download moin package - name: Download moin package
get_url: ansible.builtin.get_url:
url: "https://static.moinmo.in/files/moin-{{ moin_version }}.tar.gz" url: "https://static.moinmo.in/files/moin-{{ moin_version }}.tar.gz"
dest: "{{ srcdir }}" dest: "{{ srcdir }}"
checksum: sha1:3eb13b4730bd97259a41c4cd500f8433778ff8cf checksum: sha1:3eb13b4730bd97259a41c4cd500f8433778ff8cf
# checksum: sha1:bead31f53152395aa93c31dc3e0a8a417be39ccd
- name: extract moin package - name: Extract moin package
unarchive: ansible.builtin.unarchive:
src: "{{ srcdir }}/moin-{{ moin_version }}.tar.gz" src: "{{ srcdir }}/moin-{{ moin_version }}.tar.gz"
dest: "{{ srcdir }}" dest: "{{ srcdir }}"
owner: root owner: root
@ -35,62 +38,64 @@
creates: "{{ srcdir }}/moin-{{ moin_version }}" creates: "{{ srcdir }}/moin-{{ moin_version }}"
remote_src: true remote_src: true
- name: copy graphingwiki packages - name: Copy graphingwiki packages
git: ansible.builtin.git:
dest: "{{ srcdir }}/{{ item }}" dest: "{{ srcdir }}/{{ item }}"
repo: "https://github.com/graphingwiki/{{ item }}.git" repo: "https://github.com/graphingwiki/{{ item }}.git"
with_items: with_items:
- graphingwiki - graphingwiki
- collabbackend - collabbackend
- name: install foo.sh theme - name: Install foo.sh theme
copy: ansible.builtin.copy:
src: foosh.py src: foosh.py
dest: "{{ srcdir }}/collabbackend/collabbackend/plugin/theme/foosh.py" dest: "{{ srcdir }}/collabbackend/collabbackend/plugin/theme/foosh.py"
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: install static files for foo.sh theme - name: Install static files for foo.sh theme
synchronize: ansible.posix.synchronize:
dest: "{{ srcdir }}/collabbackend/htdocs" dest: "{{ srcdir }}/collabbackend/htdocs"
src: foo.sh src: foo.sh
delete: true delete: true
recursive: true recursive: true
- name: patch moin source - name: Patch moin source
patch: ansible.posix.patch:
src: "moin-{{ moin_version }}.patch" src: "moin-{{ moin_version }}.patch"
basedir: "{{ srcdir }}/moin-{{ moin_version }}" basedir: "{{ srcdir }}/moin-{{ moin_version }}"
- name: copy moin htdocs - name: Copy moin htdocs
command: > ansible.builtin.command:
cp -a {{ srcdir }}/moin-{{ moin_version }}/MoinMoin/web/static/htdocs \ argv:
{{ srcdir }}/moin-{{ moin_version }}/wiki - cp
args: - -a
- "{{ srcdir }}/moin-{{ moin_version }}/MoinMoin/web/static/htdocs"
- "{{ srcdir }}/moin-{{ moin_version }}/wiki"
creates: "{{ srcdir }}/moin-{{ moin_version }}/wiki/htdocs" creates: "{{ srcdir }}/moin-{{ moin_version }}/wiki/htdocs"
- name: install graphigwiki packages - name: Install graphigwiki packages
pip: ansible.builtin.pip:
name: ["{{ srcdir }}/graphingwiki", "{{ srcdir }}/collabbackend"] name: ["{{ srcdir }}/graphingwiki", "{{ srcdir }}/collabbackend"]
umask: "0022" umask: "0022"
executable: pip2 executable: pip2
extra_args: --egg --no-index extra_args: --egg --no-index
- name: install moin - name: Install moin
pip: ansible.builtin.pip:
name: "{{ srcdir }}/moin-{{ moin_version }}" name: "{{ srcdir }}/moin-{{ moin_version }}"
umask: "0022" umask: "0022"
executable: pip2 executable: pip2
extra_args: --no-index extra_args: --no-index
- name: create group collab - name: Create group collab
group: ansible.builtin.group:
name: collab name: collab
gid: 1003 gid: 1003
- name: create user collab - name: Create user collab
user: ansible.builtin.user:
name: collab name: collab
comment: Service Collab comment: Service Collab
uid: 1003 uid: 1003
@ -98,16 +103,16 @@
home: /var/lib/collab home: /var/lib/collab
shell: /sbin/nologin shell: /sbin/nologin
- name: create .profile for user collab - name: Create .profile for user collab
copy: ansible.builtin.copy:
content: "umask 077\n" content: "umask 077\n"
dest: /var/lib/collab/.profile dest: /var/lib/collab/.profile
mode: 0440 mode: 0440
owner: collab owner: collab
group: collab group: collab
- name: create config directories - name: Create config directories
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
mode: 0755 mode: 0755
owner: root owner: root
@ -117,20 +122,21 @@
- /etc/local - /etc/local
- /etc/local/collab - /etc/local/collab
- name: create collab.ini - name: Create collab.ini
copy: ansible.builtin.copy:
src: collab.ini src: collab.ini
dest: /etc/local/collab/collab.ini dest: /etc/local/collab/collab.ini
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: set selinux contexts from data directory - name: Set SELinux contexts from data directory
sefcontext: community.general.sefcontext:
path: /export/wikis(/.*)? path: /export/wikis(/.*)?
setype: httpd_sys_rw_content_t setype: httpd_sys_rw_content_t
- name: create data directory
file: - name: Create data directory
ansible.builtin.file:
path: /export/wikis path: /export/wikis
mode: 0755 mode: 0755
owner: root owner: root
@ -139,22 +145,22 @@
setype: _default setype: _default
state: directory state: directory
- name: link data directory - name: Link data directory
file: ansible.builtin.file:
src: /export/wikis src: /export/wikis
dest: /srv/wikis dest: /srv/wikis
state: link state: link
- name: create collab directory - name: Create collab directory
file: ansible.builtin.file:
path: /srv/wikis/collab path: /srv/wikis/collab
state: directory state: directory
mode: 0750 mode: 0750
owner: root owner: root
group: collab group: collab
- name: create data directories - name: Create data directories
file: ansible.builtin.file:
state: directory state: directory
path: "{{ item }}" path: "{{ item }}"
mode: 02770 mode: 02770
@ -171,24 +177,24 @@
- "/srv/wikis/collab/user" - "/srv/wikis/collab/user"
- "/srv/wikis/collab/wikis" - "/srv/wikis/collab/wikis"
- name: create tmpfs mount for cache - name: Create tmpfs mount for cache
mount: ansible.posix.mount:
state: mounted state: mounted
path: "/export/wikis/collab/cache" path: "/export/wikis/collab/cache"
src: none src: none
fstype: tmpfs fstype: tmpfs
opts: "uid=collab,gid=collab,mode=2770,context=\"{{ tmpfs_context }}\"" opts: "uid=collab,gid=collab,mode=2770,context=\"{{ tmpfs_context }}\""
- name: install htdocs/.htaccess - name: Install htdocs/.htaccess
copy: ansible.builtin.copy:
src: collab-htaccess src: collab-htaccess
dest: collab-htaccess dest: collab-htaccess
mode: 0660 mode: 0660
owner: collab owner: collab
group: collab group: collab
- name: copy configs from collabbackend archive - name: Copy configs from collabbackend archive
copy: ansible.builtin.copy:
src: "{{ srcdir }}/collabbackend/config/{{ item }}" src: "{{ srcdir }}/collabbackend/config/{{ item }}"
dest: /srv/wikis/collab/config/{{ item }} dest: /srv/wikis/collab/config/{{ item }}
mode: 0660 mode: 0660
@ -203,8 +209,8 @@
- intermap.txt - intermap.txt
- logging.conf - logging.conf
- name: extract CollabBase.zip from collabbackend archive - name: Extract CollabBase.zip from collabbackend archive
copy: ansible.builtin.copy:
src: "{{ srcdir }}/collabbackend/packages/CollabBase.zip" src: "{{ srcdir }}/collabbackend/packages/CollabBase.zip"
dest: /var/lib/collab/CollabBase.zip dest: /var/lib/collab/CollabBase.zip
mode: 0660 mode: 0660
@ -212,19 +218,19 @@
group: collab group: collab
remote_src: true remote_src: true
- name: initialize collab - name: Initialize collab
script: collab-init.sh ansible.builtin.script:
args: cmd: collab-init.sh
creates: /srv/wikis/collab/wikis/collab creates: /srv/wikis/collab/wikis/collab
- name: add collab-htaccess cron job - name: Add collab-htaccess cron job
cron: ansible.builtin.cron:
name: collab-htaccess name: collab-htaccess
user: collab user: collab
job: /usr/bin/collab-htaccess job: /usr/bin/collab-htaccess
- name: link collab to apache htdocs - name: Link collab to apache htdocs
file: ansible.builtin.file:
src: /srv/wikis/collab/htdocs src: /srv/wikis/collab/htdocs
dest: "/srv/web/{{ inventory_hostname }}/collab" dest: "/srv/web/{{ inventory_hostname }}/collab"
owner: root owner: root
@ -232,8 +238,8 @@
state: link state: link
follow: false follow: false
- name: link moin static to apache htdocs - name: Link moin static to apache htdocs
file: ansible.builtin.file:
src: /usr/share/moin/htdocs src: /usr/share/moin/htdocs
dest: "/srv/web/{{ inventory_hostname }}/moin_static" dest: "/srv/web/{{ inventory_hostname }}/moin_static"
owner: root owner: root
@ -241,32 +247,32 @@
state: link state: link
follow: false follow: false
- name: add apache to collab group - name: Add apache to collab group
user: ansible.builtin.user:
name: apache name: apache
groups: collab groups: collab
append: true append: true
notify: restart apache notify: Restart apache
- name: create apache config - name: Create apache config
template: ansible.builtin.template:
src: collab.conf.j2 src: collab.conf.j2
dest: /etc/httpd/conf.local.d/collab.conf dest: /etc/httpd/conf.local.d/collab.conf
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
notify: restart apache notify: Restart apache
- name: import sftpuser role - name: Import sftpuser role
import_role: ansible.builtin.import_role:
name: sftpuser name: sftpuser
vars: vars:
chroot: /srv/wikis/collab chroot: /srv/wikis/collab
user: backup user: backup
publickeys: "{{ backup_publickeys }}" publickeys: "{{ backup_publickeys }}"
- name: add backup user to collab group - name: Add backup user to collab group
user: ansible.builtin.user:
name: backup name: backup
groups: collab groups: collab
append: true append: true