jenkins_testeng_master.yml 1.91 KB
Newer Older
1
# Configure a Jenkins master instance for testeng
2 3 4 5 6
# This has the Jenkins Java app, but none of the requirements
# to run the tests.

- name: Configure instance(s)
  hosts: jenkins_master
7
  become: True
8
  gather_facts: True
9
  vars:
10
    COMMON_DATA_DIR: "/mnt2"
11
    COMMON_ENABLE_DATADOG: True
12
    COMMON_ENABLE_SPLUNKFORWARDER: True
13 14
    COMMON_SECURITY_UPDATES: yes
    SECURITY_UPGRADE_ON_ANSIBLE: true
15
    jenkins_jvm_args: "-Djava.awt.headless=true -Xmx8192m -XX:MaxPermSize=512m"
16 17

    SPLUNKFORWARDER_LOG_ITEMS:
18
      - source: '/var/lib/jenkins/jobs/*/builds/*/junitResult.xml'
19 20 21 22
        recursive: true
        index: 'testeng'
        sourcetype: junit
        followSymlink: false
23
        crcSalt: '<SOURCE>'
24

25
      - source: '/var/lib/jenkins/jobs/*/builds/*/build.xml'
26 27 28 29
        index: 'testeng'
        recursive: true
        sourcetype: build_result
        followSymlink: false
30
        crcSalt: '<SOURCE>'
31
        blacklist: '(((\.(gz))|\d)$)|(.*seed.*)'
32

33
      - source: '/var/lib/jenkins/jobs/*/builds/*/log'
34 35 36 37
        index: 'testeng'
        recursive: true
        sourcetype: build_log
        followSymlink: false
38
        crcSalt: '<SOURCE>'
39
        blacklist: '(((\.(gz))|\d)$)|(.*seed.*)'
40

41 42
      - source: '/var/lib/jenkins/jobs/*/builds/*/archive/test_root/log/timing.*.log'
        index: 'testeng'
43
        sourcetype: 'json_timing_log'
44 45
        followSymlink: false

46 47 48 49
      - source: '/var/log/jenkins/jenkins.log'
        index: 'testeng'
        recursive: false
        followSymlink: false
50

51
  roles:
52
    - aws
53 54
    - role: datadog
      when: COMMON_ENABLE_DATADOG
55 56
    - role: datadog-uninstall
      when: not COMMON_ENABLE_DATADOG
57
    - jenkins_master
58 59 60 61 62 63

    # run just the splunkforwarder role by using '--tags "splunkonly"'
    # e.g. ansible-playbook jenkins_testeng_master.yml -i inventory.ini --tags "splunkonly" -vvvv
    - role: splunkforwarder
      when: COMMON_ENABLE_SPLUNKFORWARDER
      tags: splunkonly
64
      become: True