Skip to content

Commit

Permalink
initial auto jenkins provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
George Adams committed Feb 9, 2018
1 parent fe59b83 commit df6316e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.idea/*
ansible/playbooks/*.retry
*.pyc
ansible/host_vars/*
ansible/host_vars
hosts
1 change: 1 addition & 0 deletions ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Debug
- Common
- Jenkins_User
- Jenkins_Master
- Ant-Contrib
- ccache
- GIT_Source
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Check if machine exists in jenkins
uri:
url: "https://ci.adoptopenjdk.net/computer/{{ ansible_hostname }}/api/json"
register: jenkins
ignore_errors: true
tags: jenkins_master

- name: SSH into the Jenkins and excute the jenkins-create-node.sh script
become: false
# TODO fetch a var instead of hard coding linux
local_action: command ssh -o StrictHostKeyChecking=no jenkins@ci.adoptopenjdk.net "/home/jenkins/.jenkins/jenkins-create-node.sh {{ inventory_hostname }} {{ ansible_host }} /home/jenkins linux,{{os}},{{arch}},{{provider}},{{ansible_architecture}},{{type}},{{ansible_distribution|lower}},{{ansible_distribution|lower}}{{ansible_distribution_major_version}}"
when:
- jenkins.status != 200
tags: jenkins_master
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Script must exist on Nagios Master
#
- name: SSH into the Nagios Master and excute the Nagios_Ansible_Config_tool.sh script
local_action: command ssh -o StrictHostKeyChecking=no root@{{ Nagios_Master_IP }} "/usr/local/nagios/Nagios_Ansible_Config_tool/Nagios_Ansible_Config_tool.sh {{ ansible_distribution }} {{ ansible_architecture }} {{ inventory_hostname }} {{ ansible_default_ipv4.address }} "
local_action: command ssh -o StrictHostKeyChecking=no root@{{ Nagios_Master_IP }} "/usr/local/nagios/Nagios_Ansible_Config_tool/Nagios_Ansible_Config_tool.sh {{ ansible_distribution }} {{ ansible_architecture }} {{ inventory_hostname }} {{ ansible_host }} "
when:
- Nagios_Monitoring == "Enabled"
- Nagios_Master_IP is defined
Expand Down

0 comments on commit df6316e

Please sign in to comment.