From 260c3a9aceede66f0e7fc5f294f278a0d2d25ab6 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sun, 10 May 2020 17:52:19 +0200 Subject: [PATCH] project management --- common.yaml | 6 ------ controllers.yaml | 13 +++++++++++-- group_vars/controllers/buildbot.yaml | 22 ++++++++++++++++++++++ group_vars/controllers/projects.yaml | 16 ++++++++++++++++ 4 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 group_vars/controllers/buildbot.yaml create mode 100644 group_vars/controllers/projects.yaml diff --git a/common.yaml b/common.yaml index 3ac84ba..3ad8528 100644 --- a/common.yaml +++ b/common.yaml @@ -6,9 +6,3 @@ remote_user: root roles: - role: common - -- hosts: - - controllers - remote_user: root - roles: - - role: tools diff --git a/controllers.yaml b/controllers.yaml index d0781f7..183001f 100644 --- a/controllers.yaml +++ b/controllers.yaml @@ -3,8 +3,17 @@ - hosts: controllers remote_user: root roles: - #- role: nginx + #- role: tools #- role: gitea - #- role: buildbot #- role: netbox #- role: alerta + - role: buildbot + tasks: + - name: create ssh keys for project users + user: + name: "{{ project }}" + generate_ssh_key: yes + ssh_key_type: ed25519 + loop: "{{ projects.keys() }}" + loop_control: + loop_var: project diff --git a/group_vars/controllers/buildbot.yaml b/group_vars/controllers/buildbot.yaml new file mode 100644 index 0000000..2eabcff --- /dev/null +++ b/group_vars/controllers/buildbot.yaml @@ -0,0 +1,22 @@ +buildbot_server_name: buildbot.testing.thengo.net +buildbot_workers: |- + { + {% for project_name in projects.keys() %} + {{ project_name | to_json }}: {}, + {% endfor %} + } +buildbot_builders: |- + { + {% for project_name in projects.keys() %} + {% set project = projects[project_name] %} + {% if project.builders is defined %} + {% for builder_name in project.builders.keys() %} + {% set builder = project.builders[builder_name] %} + {{ ( project_name + '-' + builder_name ) | to_json }}: + {{ builder | combine({'worker_names':[project_name]}) | to_json }}, + {% endfor %} + {% endif %} + {% endfor %} + } + +buildbot_gitea_webhook_secret: theow0po5faChaeM5ki2chie diff --git a/group_vars/controllers/projects.yaml b/group_vars/controllers/projects.yaml new file mode 100644 index 0000000..c7d0394 --- /dev/null +++ b/group_vars/controllers/projects.yaml @@ -0,0 +1,16 @@ +--- + +projects: + testing: + builders: + infrastructure: + repos: + - name: testing repo + type: gitea + workdir: testing + repourl: ssh://git@git.testing.thengo.net/thengo-testing/testing.git + shell_commands: + - name: ansible + command: echo Hello World! + workdir: testing + force_scheduler: true