From 5d89d2fabc260ab0d0594d3688ca279fdcc249aa Mon Sep 17 00:00:00 2001 From: binary Date: Thu, 14 Jan 2021 17:51:48 +0100 Subject: Add jenkins role --- host_vars/st0-devel | 13 +++++++++++++ host_vars/stack0.yml | 7 +++++++ playbooks/vm1.rgoncalves.se.yml | 1 + roles/jenkins/tasks/main.yml | 27 +++++++++++++++++++++++++++ roles/jenkins/vars/main.yml | 8 ++++++++ 5 files changed, 56 insertions(+) create mode 100644 host_vars/st0-devel create mode 100644 roles/jenkins/tasks/main.yml create mode 100644 roles/jenkins/vars/main.yml diff --git a/host_vars/st0-devel b/host_vars/st0-devel new file mode 100644 index 0000000..8c04667 --- /dev/null +++ b/host_vars/st0-devel @@ -0,0 +1,13 @@ +ansible_host: st0-devel +ip: + in: 10.10.0.63 + out: 192.168.5.63 + +virtual: true + +services: + + - name: "ssh" + proto: "tcp" + port: "22" + diff --git a/host_vars/stack0.yml b/host_vars/stack0.yml index 93e96ea..f3a6c81 100644 --- a/host_vars/stack0.yml +++ b/host_vars/stack0.yml @@ -34,6 +34,13 @@ vms: disks: - { id: 0, size: "4G" } + - name: st0-devel + image: alpine + memory: 4G + cpu: 2 + disks: + - { id: 0, size: "8G" } + hypervisor: interface: bce0 switch: public diff --git a/playbooks/vm1.rgoncalves.se.yml b/playbooks/vm1.rgoncalves.se.yml index 2d0fae5..0ac208f 100644 --- a/playbooks/vm1.rgoncalves.se.yml +++ b/playbooks/vm1.rgoncalves.se.yml @@ -9,4 +9,5 @@ roles: - { role: grafana } + - { role: jenkins } # - { role: nextcloud } diff --git a/roles/jenkins/tasks/main.yml b/roles/jenkins/tasks/main.yml new file mode 100644 index 0000000..cac34e6 --- /dev/null +++ b/roles/jenkins/tasks/main.yml @@ -0,0 +1,27 @@ + +# jenkins ~~ roles/jenkins/tasks/main.yml +# jenkins setup + +--- + +- name: install jenkins + package: + name: jenkins + state: present + +- name: ensure jenkins group exists + group: + name: "{{ jenkins_group }}" + state: present + +- name: ensure jenkins user exists + user: + name: "{{ jenkins_user }}" + group: "{{ jenkins_group }}" + state: present + +- name: start and enable jenkins service + service: + name: jenkins + state: restarted + enabled: true diff --git a/roles/jenkins/vars/main.yml b/roles/jenkins/vars/main.yml new file mode 100644 index 0000000..7596f1d --- /dev/null +++ b/roles/jenkins/vars/main.yml @@ -0,0 +1,8 @@ + +# jenkins ~~ roles/jenkins/vars/main.yml +# jenkins variables + +--- + +jenkins_group: jenkins +jenkins_user: jenkins -- cgit v1.2.3