Skip to content
Snippets Groups Projects
Select Git revision
  • eddff3ab97b7c053f4c69ece9c8cb069336f3592
  • master default protected
  • th/caddy-wip
  • th/caddy
  • th/lego
  • th/acmebot
  • pyzabbix
  • th/keycloak
8 results

main.yml

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    main.yml 2.71 KiB
    ---
    
    - name: ensure nodejs is installed
      apt:
        name:
          - nodejs
          - npm
        state: present
    
    - name: ensure we have a group for etherpads
      group:
        name: etherpad
        state: present
        system: true
    
    - name: ensure we have a user for etherpads
      user:
        name: etherpad
        group: etherpad
        state: present
        system: true
        shell: /usr/bin/nologin
        home: "{{etherpad_web_root}}"
        createhome: false
    
    - name: ensure we have a directory for the etherpad software
      file:
        path: "{{etherpad_web_root}}/repository"
        state: directory
        owner: etherpad
        group: etherpad
        mode: '0755'
    
    - name: ensure we have the etherpad software
      git:
        repo: https://github.com/ether/etherpad-lite.git
        dest: "{{etherpad_web_root}}/repository"
        version: "{{etherpad_version|default('HEAD')}}"
      become: true
      become_user: etherpad
    
    - name: ensure we have a directory for etherpad configuration files
      file:
        path: /etc/etherpad
        state: directory
        owner: root
        group: etherpad
        mode: '0750'
    
    - name: ensure we have a mysql database for the etherpad
      mysql_db:
        name: "{{item.db_name}}"
        state: present
        login_user: root
        login_password: "{{mysql_root_password}}"
      with_items: "{{etherpads}}"
      when: item.db_type == 'mysql'
      no_log: true
    
    - name: ensure we have a mysql database user for the etherpad
      mysql_user:
        name: "{{item.db_user}}"
        password: "{{item.db_password}}"
        state: present
        login_user: root
        login_password: "{{mysql_root_password}}"
        priv: "{{item.db_name}}.*:ALL"
      with_items: "{{etherpads}}"
      when: item.db_type == 'mysql'
      no_log: true