@@ -6,6 +6,8 @@ buildbot_db_pass: "{{ ansible_local.buildbot.database_password }}" | |||||
buildbot_server_name: "{{ inventory_hostname }}" | 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_builders: {} | ||||
buildbot_hello_world_example: true | buildbot_hello_world_example: true | ||||
buildbot_local_worker: true |
@@ -40,7 +40,15 @@ c['db'] = { | |||||
# Local Worker | # Local Worker | ||||
{% if buildbot_local_worker %} | |||||
c['workers'].append(worker.LocalWorker("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 | # Hello World Example | ||||
{% if buildbot_hello_world_example %} | {% if buildbot_hello_world_example %} | ||||
@@ -2,6 +2,8 @@ | |||||
_local_facts: | _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 %}" | 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_database_url: "postgresql://{{buildbot_db_user}}:{{buildbot_db_pass}}@localhost:5432/{{buildbot_db_name}}" | ||||
buildbot_nginx_vhosts: | buildbot_nginx_vhosts: | ||||