- api_user: 'ceph-jenkins'
- token: '{{ token }}'
- api_uri: 'https://jenkins.ceph.com'
+ - jenkins_credentials_uuid: '39fa150b-b2a1-416e-b334-29a9a2c0b32d'
- nodename: '{{ nodename }}'
- labels: '{{ labels }}'
- use_jnlp: false
tasks:
+ - name: uninstall resolvconf on Ubuntu to manually manage resolv.conf
+ apt:
+ name: resolvconf
+ state: absent
+ when: ansible_os_family == "Debian"
+
+ - name: check for NetworkManager conf
+ stat:
+ path: /etc/NetworkManager/NetworkManager.conf
+ register: nm_conf
+
+ - name: tell NetworkManager to leave resolv.conf alone on CentOS
+ lineinfile:
+ dest: /etc/NetworkManager/NetworkManager.conf
+ regexp: '^dns='
+ line: 'dns=none'
+ state: present
+ when: ansible_os_family == "RedHat" and nm_conf.stat.exists
+
+ - name: tell dhclient to leave resolv.conf alone on Ubuntu
+ lineinfile:
+ dest: /etc/dhcp/dhclient.conf
+ regexp: 'prepend domain-name-servers'
+ line: 'supersede domain-name-servers 8.8.8.8;'
+ state: present
+ when: ansible_os_family == "Debian"
+
+ - name: use Google DNS for name resolution
+ lineinfile:
+ dest: /etc/resolv.conf
+ regexp: '^nameserver'
+ line: 'nameserver 8.8.8.8'
+ state: present
+
- name: create a {{ jenkins_user }} user
user: name={{ jenkins_user }} comment="Jenkins Build Slave User"
name: "{{ ansible_default_ipv4.address }}+{{ nodename }}"
labels: "{{ labels }}"
host: "{{ ansible_default_ipv4.address }}"
- credentialsId: '39fa150b-b2a1-416e-b334-29a9a2c0b32d'
+ credentialsId: "{{ jenkins_credentials_uuid }}"
remoteFS: '/home/{{ jenkins_user }}/build'
executors: '{{ executors|default(1) }}'
exclusive: true
name: "{{ ansible_default_ipv4.address }}+{{ nodename }}"
labels: "{{ labels }}"
host: "{{ ansible_default_ipv4.address }}"
- credentialsId: '39fa150b-b2a1-416e-b334-29a9a2c0b32d'
+ credentialsId: "{{ jenkins_credentials_uuid }}"
launcher: 'hudson.slaves.JNLPLauncher'
remoteFS: '/home/{{ jenkins_user }}/build'
# XXX this should be configurable, not all nodes should have one executor
- api_user: 'ceph-jenkins'
- token: '{{ token }}'
- api_uri: 'https://jenkins.ceph.com'
+ - jenkins_credentials_uuid: '39fa150b-b2a1-416e-b334-29a9a2c0b32d'
- nodename: '{{ nodename }}'
- labels: '{{ labels }}'
- use_jnlp: false
tasks:
+ - name: uninstall resolvconf on Ubuntu to manually manage resolv.conf
+ apt:
+ name: resolvconf
+ state: absent
+ when: ansible_os_family == "Debian"
+
+ - name: check for NetworkManager conf
+ stat:
+ path: /etc/NetworkManager/NetworkManager.conf
+ register: nm_conf
+
+ - name: tell NetworkManager to leave resolv.conf alone on CentOS
+ lineinfile:
+ dest: /etc/NetworkManager/NetworkManager.conf
+ regexp: '^dns='
+ line: 'dns=none'
+ state: present
+ when: ansible_os_family == "RedHat" and nm_conf.stat.exists
+
+ - name: tell dhclient to leave resolv.conf alone on Ubuntu
+ lineinfile:
+ dest: /etc/dhcp/dhclient.conf
+ regexp: 'prepend domain-name-servers'
+ line: 'supersede domain-name-servers 8.8.8.8;'
+ state: present
+ when: ansible_os_family == "Debian"
+
+ - name: use Google DNS for name resolution
+ lineinfile:
+ dest: /etc/resolv.conf
+ regexp: '^nameserver'
+ line: 'nameserver 8.8.8.8'
+ state: present
# vagrant doesn't have repositories, this chacra repo will be better to have
# around and can get updates as soon as a new vagrant version is published via
- set_fact:
jenkins_group: 'libvirt'
- when: ansible_distribution_version == '16.10'
+ when: ansible_distribution_version == '17.04'
- name: create a {{ jenkins_user }} user
user:
when:
ansible_distribution_release in ['precise', 'trusty', 'wheezy', 'jessie']
- - name: Install default openjdk for Xenial only
+ - name: Install default openjdk for Xenial or Zesty
apt: name={{ item }} state=present
with_items:
- default-jdk
- default-jre
when:
- ansible_distribution_release == 'xenial'
+ ansible_distribution_release in ['xenial', 'zesty']
- name: correct java version selected
alternatives: name=java path=/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
name: "{{ ansible_default_ipv4.address }}+{{ nodename }}"
labels: "{{ labels }}"
host: "{{ ansible_default_ipv4.address }}"
- credentialsId: '39fa150b-b2a1-416e-b334-29a9a2c0b32d'
+ credentialsId: "{{ jenkins_credentials_uuid }}"
remoteFS: '/home/{{ jenkins_user }}/build'
executors: '{{ executors|default(1) }}'
exclusive: true
name: "{{ ansible_default_ipv4.address }}+{{ nodename }}"
labels: "{{ labels }}"
host: "{{ ansible_default_ipv4.address }}"
- credentialsId: '39fa150b-b2a1-416e-b334-29a9a2c0b32d'
+ credentialsId: "{{ jenkins_credentials_uuid }}"
launcher: 'hudson.slaves.JNLPLauncher'
remoteFS: '/home/{{ jenkins_user }}/build'
# XXX this should be configurable, not all nodes should have one executor