commit 6986e4b293fd521c90fbf96935a9030987f2c267 Author: lhahn Date: Sun Aug 20 11:13:57 2023 +0200 Git initial commit diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..2071b23 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100755 index 0000000..4b3f012 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# cloud-openproject + +Ansible role to provide openproject as project management software. \ No newline at end of file diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100755 index 0000000..5151e7b --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,25 @@ +--- +cloud_apps: /opt +cloud_storage: /opt/storage +cloud_stage: prod +cloud_update: false +domain_external: my-domain.tld + +openproject_major: 12 + +openproject_db: + type: pgsql + name: openproject_db + user: openproject_dbu + pass: openproject_dbpw + port: 5432 + host: localhost + +openproject_mail_smtp_host: "mail.{{ domain_external }}" +openproject_mail_smtp_port: 25 +openproject_mail_smtp_user: "openproject@{{ domain_external }}" +openproject_mail_smtp_pass: ThisCouldBeYourAd! +openproject_mail_smtp_domain: "{{ openproject_mail_smtp_host }}" +openproject_mail_admin: "admin@{{ domain_external }}" + +openproject_domain: "localhost" diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100755 index 0000000..69ebf12 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: install openproject + command: openproject configure diff --git a/meta/main.yml b/meta/main.yml new file mode 100755 index 0000000..3836124 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,17 @@ +--- +galaxy_info: + role_name: openproject + namespace: hahn-cloud + author: Lars Hahn + company: OpenDevChain + license: MIT + description: Role to setup OpenProject. + min_ansible_version: 2.7 + platforms: + - name: Debian + versions: + - 11 + galaxy_tags: + - openproject +dependencies: + - postgres diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100755 index 0000000..27aa546 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,45 @@ +--- +- name: install requirements for openproject + apt: + update_cache: yes + state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}" + install_recommends: yes + pkg: + - apt-transport-https + - ca-certificates + - gnupg2 + - software-properties-common + - curl + +- name: install openproject repository key + apt_key: + url: https://dl.packager.io/srv/opf/openproject/key + state: present + + +- name: install openproject repository + get_url: + url: https://dl.packager.io/srv/opf/openproject/stable/{{ openproject_major }}/installer/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}.repo + dest: /etc/apt/sources.list.d/openproject.list + owner: root + group: root + mode: 644 + force: yes + +- name: install openproject + apt: + update_cache: yes + state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}" + install_recommends: yes + pkg: openproject + register: openproject_install + +- name: template installation file + template: + src: etc/openproject/installer.dat.j2 + dest: /etc/openproject/installer.dat + owner: openproject + group: openproject + mode: 0640 + notify: install openproject + when: openproject_install.changed \ No newline at end of file diff --git a/templates/etc/openproject/installer.dat.j2 b/templates/etc/openproject/installer.dat.j2 new file mode 100755 index 0000000..0a283e2 --- /dev/null +++ b/templates/etc/openproject/installer.dat.j2 @@ -0,0 +1,22 @@ +openproject/edition default + +postgres/autoinstall reuse +postgres/db_host {{ openproject_db.host | default('localhost') }} +postgres/db_port {{ openproject_db.port | default('5432') }} +postgres/db_username {{ openproject_db.user }} +postgres/db_password {{ openproject_db.pass }} +postgres/db_name {{ openproject_db.name }} +server/autoinstall skip +smtp/autoinstall smtp +smtp/authentication login + +smtp/host {{ openproject_mail_smtp_host }} +smtp/port {{ openproject_mail_smtp_port }} +smtp/username {{ openproject_mail_smtp_user }} +smtp/password {{ openproject_mail_smtp_pass }} +smtp/domain {{ openproject_mail_smtp_domain }} +smtp/admin_email {{ openproject_mail_admin }} +memcached/autoinstall install + +server/hostname {{ openproject_domain }} +server/ssl no diff --git a/vars/main.yml b/vars/main.yml new file mode 100755 index 0000000..cd21505 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +