Newer
Older
Chris Hines
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
- name: define nhc_src_url
set_fact:
nhc_src_url: "http://consistency0/src/{{ nhc_version }}.tar.gz"
when: nhc_src_url is not defined
- name: check existing installation
stat: path="{{ nhc_dir }}/sbin/nhc"
register: nhc_binary
- name: install automake
yum: name=automake state=present
become: true
become_user: root
when: ansible_os_family=='RedHat'
- name: install automake
apt: name=automake state=present
become: true
become_user: root
when: ansible_os_family=='Debian'
- name: download nhc
get_url:
url: "{{ nhc_src_url }}"
checksum: "{{ nhc_src_checksum }}"
dest: "{{ src_base }}/nhc.tar.gz"
when: nhc_src_checksum is defined
- name: download nhc
get_url:
url: "{{ nhc_src_url }}"
dest: "{{ src_base }}/nhc.tar.gz"
when: nhc_src_checksum is not defined
- name: unarchive nhc
unarchive:
args:
src: "{{ src_base }}/nhc.tar.gz"
copy: no
dest: "{{ src_base }}"
creates: "{{ nhc_src_dir }}/autogen.sh"
when: not nhc_binary.stat.exists
- name: build nhc
shell: ./autogen.sh && ./configure --prefix={{ nhc_dir }} && make
args:
chdir: "{{ nhc_src_dir }}"
creates: "{{ nhc_src_dir }}/configure"
when: not nhc_binary.stat.exists
- name: install nhc
shell: make install
become: true
args:
chdir: "{{ nhc_src_dir }}"
when: not nhc_binary.stat.exists
- name: ensure sysconfig dir exists
file: dest=/etc/sysconfig state=directory owner=root group=root mode=755
become: true
- name: copy nhc sysconfig script
template: dest=/etc/sysconfig/nhc src=nhc.sysconfig.j2 mode=644
become: true
- name: copy nhc log rotate script
template: dest=/etc/logrotate.d/nhc src=nhclog.j2 mode=644
become: true
- name: install nhc config file
copy: src=nhc.conf dest={{ nhc_dir }}/etc/nhc/{{ nhc_config_file }}
become: true
become_user: root
- name: install nhc scripts
copy: src=scripts/ dest={{ nhc_dir }}/etc/nhc/scripts/
become: true
become_user: root
#test NAT is working by pinging an external address, i.e. a license server, or by default Google Public DNS
- set_fact:
EXTERNAL_IP_ADDRESS: "8.8.8.8"
when: EXTERNAL_IP_ADDRESS is undefined
- name: install nhc NAT check
template: dest="{{ nhc_dir }}/etc/nhc/scripts/check_nat.nhc" src=check_nat.nhc.j2
become: true
become_user: root
when: ADD_NHC_NAT_CHECK is defined