Преглед изворни кода

configure local workers with settings from buildbot-worker role

covid-videoplattform
Markus Katharina Brechtel пре 4 година
родитељ
комит
e9a2316184
3 измењених фајлова са 12 додато и 0 уклоњено
  1. +2
    -0
      defaults/main.yaml
  2. +8
    -0
      templates/buildbot/master.cfg.j2
  3. +2
    -0
      vars/main.yaml

+ 2
- 0
defaults/main.yaml Прегледај датотеку

@@ -6,6 +6,8 @@ buildbot_db_pass: "{{ ansible_local.buildbot.database_password }}"

buildbot_server_name: "{{ inventory_hostname }}"

buildbot_workers: "{ {% for name in _buildbot_worker_names %} \"{{name}}\": {\"password\":\"{{ansible_local['buildbot_worker_'+name].worker_password}}\"} {% endfor %} }"
buildbot_builders: {}

buildbot_hello_world_example: true
buildbot_local_worker: true

+ 8
- 0
templates/buildbot/master.cfg.j2 Прегледај датотеку

@@ -40,7 +40,15 @@ c['db'] = {


# Local Worker
{% if buildbot_local_worker %}
c['workers'].append(worker.LocalWorker("local-worker"))
{% endif %}

# Ansible Defined Workers
{% for worker_name in buildbot_workers.keys() %}
{% set worker = buildbot_workers[worker_name] %}
c['workers'].append(worker.Worker('{{worker_name}}', '{{worker.password}}'))
{% endfor %}

# Hello World Example
{% if buildbot_hello_world_example %}


+ 2
- 0
vars/main.yaml Прегледај датотеку

@@ -2,6 +2,8 @@
_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_worker_names: "{{ ansible_local.keys() | map('regex_search', '^buildbot_worker_(.*)$') | select('string') | map('regex_replace', '^buildbot_worker_(.*)$', '\\1') | list }}"

buildbot_database_url: "postgresql://{{buildbot_db_user}}:{{buildbot_db_pass}}@localhost:5432/{{buildbot_db_name}}"

buildbot_nginx_vhosts:


Loading…
Откажи
Сачувај