diff --git a/ansible/new-service-playbook.yml b/ansible/new-service-playbook.yml new file mode 100644 index 0000000..b92c11f --- /dev/null +++ b/ansible/new-service-playbook.yml @@ -0,0 +1,30 @@ +- name: Auto-provision new service pipeline + hosts: localhost + gather_facts: false + + #TODO: docs? + # For the git clone and git push commands to work smoothly inside this playbook, + # ensure your shell environment is passing your SSH key. Run ssh-add -l on your + # terminal before firing up ansible-playbook. + + # TODO + # If the machine executing this playbook doesn't have a global Git user configured, + # the git commit task will fail. You can explicitly bypass this by adding environment + # variables directly to the commit task if needed: + # environment: + # GIT_COMMITTER_NAME: "Ansible Provisioner" + # GIT_COMMITTER_EMAIL: "your-email@psi.ch" + # GIT_AUTHOR_NAME: "Ansible Provisioner" + # GIT_AUTHOR_EMAIL: "your-email@psi.ch" + + tasks: + - name: "Step 0: " + ansible.builtin.import_tasks: tasks/00-create-service.yml + # These variables are only visible inside this task + vars: + service_name: "OPTICSFF-X09L" + sls_bd_repo_url: "git@gitea.psi.ch:autodeploy_bin/sls_bd.git" + target_branch: "feature/add-{{ service_name | lower }}" # e.g., feature/add-tunefbx + workspace_dir: "/tmp/sls_bd_workspace" + tags: + - step_00 diff --git a/ansible/tasks/00-create-service.yml b/ansible/tasks/00-create-service.yml new file mode 100644 index 0000000..e69de29