summaryrefslogtreecommitdiff
path: root/baserock_openid_provider/instance-config.yml
blob: a0dd059e47b1ba21db6e639d8d388c8556cabf68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Instance configuration for Baserock OpenID provider.
#
# This playbook should be run after starting an instance of the Baserock
# OpenID Provider image.
---
- hosts: openid
  gather_facts: False
  sudo: yes
  tasks:
  - name: install database password
    copy:
      content: "{{ lookup('file', '../baserock_database/baserock_openid_provider.database_password.yml') }}"
      dest: /etc/baserock_openid_provider.database_password.yml
      owner: cherokee
      group: cherokee
      mode: 400

  - name: install Django secret key
    copy:
      content: "{{ lookup('file', 'baserock_openid_provider.secret_key.yml') }}"
      dest: /etc/baserock_openid_provider.secret_key.yml
      owner: cherokee
      group: cherokee
      mode: 400

  # This step could be part of image creation, except that because the secret
  # key file wouldn't be available at that time, the 'manage.py' script would
  # fail to run.
  - name: install static content
    django_manage: app_path=/srv/baserock_openid_provider command=collectstatic
    sudo_user: cherokee

  - name: run database migrations
    django_manage: app_path=/srv/baserock_openid_provider command=migrate
    sudo_user: cherokee

  # Default configuration of Sendmail in Fedora is to only accept connections from
  # localhost. This is what we want, so no extra config required.
  - name: enable and start sendmail service
    service: name=sendmail enabled=yes state=started

  - name: enable and start Cherokee service
    service: name=cherokee enabled=yes state=restarted

  - name: enable and start ntpd service
    service: name=ntpd enabled=yes state=restarted