diff --git a/defaults/main.yml b/defaults/main.yml index fb6501123304148992324aa873bcdb32386d43f6..6cfb3b78227e4795ac0fbf40717d99289c61d4c8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,2 @@ -discourse_git_repo: 'https://github.com/discourse/discourse_docker.git' -discourse_domain: '' +discourse_git_repo: https://github.com/discourse/discourse_docker.git +discourse_domain: diff --git a/tasks/apache.yml b/tasks/apache.yml index 7dedb5151b466d000883f9dc5ae350307c85250b..f729d51ed5d0cadf07c2d823dcc54df938e66be7 100644 --- a/tasks/apache.yml +++ b/tasks/apache.yml @@ -1,30 +1,30 @@ --- # file: roles/discourse/tasks/apache.yml -- name: "Apache Configuration File" +- name: Apache Configuration File template: - src: 'vhost.conf' - dest: '/etc/apache2/sites-available/discourse{{ apache_conf_ext }}' - owner: 'root' - group: 'root' - mode: '664' + src: vhost.conf + dest: /etc/apache2/sites-available/discourse{{ apache_conf_ext }} + owner: root + group: root + mode: 664 notify: - "Apache | Restart Apache" -- name: "Apache enable our new site(s)" +- name: Apache enable our new site(s) command: a2ensite discourse creates=/etc/apache2/sites-enabled/discourse{{ apache_conf_ext }} notify: - "Apache | Restart Apache" - block: - - name: "Setup AuthType Basic" + - name: Setup AuthType Basic htpasswd: - path: '/var/discourse/containers/passwords' + path: /var/discourse/containers/passwords name: '{{ discourse_apache_auth.user }}' password: '{{ discourse_apache_auth.password }}' - owner: 'root' - group: 'root' - mode: '664' + owner: root + group: root + mode: 664 when: discourse_apache_auth is defined diff --git a/tasks/install.yml b/tasks/install.yml index d61c4cfcc975da086b9ff01d7c82a0cd62f07eb2..510b4cf6e43758b64bf59f3bd5aae752aec3b03a 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,27 +1,27 @@ --- # file: roles/discourse/tasks/install.yml -- name: "Clone Repository" +- name: Clone Repository git: accept_hostkey: yes repo: '{{ discourse_git_repo }}' - dest: '/var/discourse' + dest: /var/discourse register: discourse_repository - block: - - name: "Configure" + - name: Configure template: - src: 'app.yml' - dest: '/var/discourse/containers/app.yml' - owner: 'root' - group: 'root' - mode: '664' + src: app.yml + dest: /var/discourse/containers/app.yml + owner: root + group: root + mode: 664 - - name: "Install and Build" - shell: '/var/discourse/launcher rebuild app' + - name: Install and Build + shell: /var/discourse/launcher rebuild app when: discourse_repository.changed -- name: "Configure Apache" +- name: Configure Apache import_tasks: apache.yml diff --git a/tasks/main.yml b/tasks/main.yml index 79ba2bd5febf264c83809eab70c7aff7ee3ed289..d06ca1e4eb4dc1ac5e871cc1d224286008305269 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,24 +1,26 @@ --- # file: roles/discourse/tasks/main.yml -- name: "Docker Discourse" - set_fact: role_discourse_started=true - tags: 'always' +- name: Docker Discourse + set_fact: + role_discourse_started: yes + tags: + - always - block: - - name: "Install Certs" - include_tasks: '../../letsencrypt/tasks/cert.yml' + - name: Install Certs + include_tasks: ../../letsencrypt/tasks/cert.yml with_items: - domain: '{{ discourse_domain }}' loop_control: loop_var: domain when: discourse_protocol|default("https") == "https" and discourse_letsencrypt|default(true) - when: '"letsencrypt" not in excluded_roles and groups.proxyserver is not defined' + when: not excluded_roles or "letsencrypt" not in excluded_roles and groups.proxyserver is not defined - block: - - name: "Install Discourse" + - name: Install Discourse import_tasks: install.yml - when: '"discourse" not in excluded_roles' + when: not excluded_roles or "discourse" not in excluded_roles diff --git a/templates/app.yml b/templates/app.yml index 9a41b7a6443dce0d00a7dd67a655d030aac9c5f4..e90bd4dd2d2a4d62cd2295e0790a70e3890cdc56 100644 --- a/templates/app.yml +++ b/templates/app.yml @@ -47,7 +47,7 @@ env: #UNICORN_WORKERS: 3 ## TODO: The domain name this Discourse instance will respond to - DISCOURSE_HOSTNAME: {{ discourse_domain }} + DISCOURSE_HOSTNAME: '{{ discourse_domain }}' ## Uncomment if you want the container to be started with the same ## hostname (-h option) as specified above (default "$hostname-$config") @@ -58,9 +58,9 @@ env: DISCOURSE_DEVELOPER_EMAILS: '{{ apache_server_admin }}' ## TODO: The SMTP mail server used to validate new accounts and send notifications - DISCOURSE_SMTP_ADDRESS: {{ discourse_smtp.host }} - DISCOURSE_SMTP_PORT: {{ discourse_smtp.port }} - DISCOURSE_SMTP_USER_NAME: {{ discourse_smtp.user }} + DISCOURSE_SMTP_ADDRESS: '{{ discourse_smtp.host }}' + DISCOURSE_SMTP_PORT: '{{ discourse_smtp.port }}' + DISCOURSE_SMTP_USER_NAME: '{{ discourse_smtp.user }}' DISCOURSE_SMTP_PASSWORD: "{{ discourse_smtp.pass }}" #DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)