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