@@ -1 +1,5 @@ | |||||
--- | --- | ||||
buildbot_db_name: buildbot | |||||
buildbot_db_user: buildbot | |||||
buildbot_db_pass: "{{ ansible_local.buildbot.database_password }}" |
@@ -0,0 +1,16 @@ | |||||
--- | |||||
- block: | |||||
- name: postgresql user | |||||
postgresql_user: | |||||
name: "{{buildbot_db_user}}" | |||||
password: "{{buildbot_db_pass}}" | |||||
- name: postgresql database | |||||
postgresql_db: | |||||
name: "{{buildbot_db_name}}" | |||||
owner: "{{buildbot_db_user}}" | |||||
become: true | |||||
become_user: postgres |
@@ -0,0 +1,16 @@ | |||||
--- | |||||
- name: ansible local facts directory | |||||
file: | |||||
path: /etc/ansible/facts.d | |||||
state: directory | |||||
- name: set ansible local fact | |||||
copy: | |||||
content: "{{_local_facts|to_json}}" | |||||
dest: /etc/ansible/facts.d/{{_local_facts_name}}.fact | |||||
register: _local_facts_set | |||||
- name: Gathering Facts | |||||
setup: | |||||
when: _local_facts_set.changed |
@@ -1,11 +1,16 @@ | |||||
--- | --- | ||||
- import_tasks: local_facts.yaml | |||||
- name: debian package requirements for buildbot | - name: debian package requirements for buildbot | ||||
apt: | apt: | ||||
pkg: | pkg: | ||||
- python3-pip | - python3-pip | ||||
- fish | - fish | ||||
- git | - git | ||||
- python-psycopg2 | |||||
- postgresql | |||||
- name: install buildbot | - name: install buildbot | ||||
pip: | pip: | ||||
@@ -43,3 +48,5 @@ | |||||
copy: | copy: | ||||
src: systemd/buildbot@.service | src: systemd/buildbot@.service | ||||
dest: /etc/systemd/system/buildbot@.service | dest: /etc/systemd/system/buildbot@.service | ||||
- import_tasks: database.yaml |
@@ -1 +1,7 @@ | |||||
--- | --- | ||||
_local_facts_name: buildbot | |||||
_local_facts: | |||||
database_password: "{% if not ansible_local.buildbot.database_password is defined %}{{ lookup('password', '/dev/null length=16 chars=ascii_letters') }}{% else %}{{ ansible_local.buildbot.database_password }}{% endif %}" | |||||
buildbot_database_url: "postgresql://{{buildbot_db_user}}:{{buildbot_db_pass}}@localhost:5432/{{buildbot_db_name}}" |