~verterok/charms/trusty/conn-check/fix-nrpe-check-hostname

« back to all changes in this revision

Viewing changes to playbook.yaml

  • Committer: Wes Mason
  • Date: 2015-03-06 17:05:10 UTC
  • mfrom: (7.3.22 precise-no-nagios)
  • Revision ID: wesley.mason@canonical.com-20150306170510-cyco58xpv2vq4sbn
Merge no-nagios changes from precise-no-nagios

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
    env_dir: /srv/conn-check/virtualenvs
5
5
    wheels_dir: /srv/conn-check/wheels-exports
6
6
    config_path: /srv/conn-check/config.yaml
 
7
    setuptools_url: bzr+https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/python-setuptools/trusty#egg=setuptools
 
8
    pip_url: bzr+https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/python-pip/trusty#egg=pip
 
9
    venv_pip: "{{ env_dir }}/{{ revision }}/bin/pip"
7
10
 
8
11
  tasks:
9
12
 
43
46
        - "{% if revision != 'head' -%} -r tag:conn-check-r{{ revision }} {%- endif %}"
44
47
      when: not wheels_path_stat.stat.exists
45
48
 
 
49
    - name: check minimum pip version is installed
 
50
      tags: config-changed
 
51
      # We check virtualenv'd pip first if the path exists, otherwise system pip
 
52
      shell: "dpkg --compare-versions $(echo $(test -e {{ venv_pip }} && {{ venv_pip }} --version || pip --version) | awk '{print $2}') ge 1.4"
 
53
      ignore_errors: True
 
54
      register: pip_version
 
55
 
 
56
    - name: create virtualenv
 
57
      tags: config-changed
 
58
      shell: "virtualenv {{ env_dir }}/{{ revision }}"
 
59
      when: pip_version.rc != 0
 
60
 
 
61
    - name: ensure upgraded setuptools in virtualenv
 
62
      tags: config-changed
 
63
      shell: "{{ env_dir }}/{{ revision }}/bin/pip install -U {{ setuptools_url }}"
 
64
      when: pip_version.rc != 0
 
65
 
 
66
    - name: ensure upgraded pip in virtualenv
 
67
      tags: config-changed
 
68
      shell: "{{ env_dir }}/{{ revision }}/bin/pip install -U {{ pip_url }}"
 
69
      when: pip_version.rc != 0
 
70
 
46
71
    - name: install conn-check
47
72
      tags: config-changed
48
73
      pip:
66
91
        - conn-check-relation-changed
67
92
        - nrpe-external-master-relation-changed
68
93
      copy:
69
 
        content: "command[conn_check]={{ env_dir }}/{{ revision }}/bin/conn-check {{ args }} {{ config_path }}"
 
94
        content: "command[conn_check]={{ env_dir }}/{{ revision }}/bin/conn-check --exclude-tags=no-nagios {{ args }} {{ config_path }}"
70
95
        dest: "/etc/nagios/nrpe.d/check_conn_check.cfg"
71
96
        owner: nagios
72
97
        group: nagios
102
127
    - name: run check
103
128
      tags: run-check
104
129
      shell: "sudo -u conn-check {{ env_dir }}/{{ revision }}/bin/conn-check {{ args }} {{ config_path }}"
 
130
 
 
131
    - name: run nagios checks
 
132
    tags: run-nagios-check
 
133
    shell: "sudo -u conn-check {{ env_dir }}/{{ revision }}/bin/conn-check --exclude-tags=no-nagios {{ args }} {{ config_path }}"