diff options
author | binary <me@rgoncalves.se> | 2021-01-14 17:51:48 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2021-01-14 17:51:48 +0100 |
commit | 5d89d2fabc260ab0d0594d3688ca279fdcc249aa (patch) | |
tree | 27eeb6e48be7c44ba7ec7d1cb48df09ced0d4426 | |
parent | 5e6f92895f11c62565c23a6cbad2dac73118569d (diff) | |
download | infrastructure-5d89d2fabc260ab0d0594d3688ca279fdcc249aa.tar.gz |
Add jenkins role
-rw-r--r-- | host_vars/st0-devel | 13 | ||||
-rw-r--r-- | host_vars/stack0.yml | 7 | ||||
-rw-r--r-- | playbooks/vm1.rgoncalves.se.yml | 1 | ||||
-rw-r--r-- | roles/jenkins/tasks/main.yml | 27 | ||||
-rw-r--r-- | roles/jenkins/vars/main.yml | 8 |
5 files changed, 56 insertions, 0 deletions
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 |