Newer
Older
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
- name: install deps
apt: name={{ item }} state=installed update_cache=yes
sudo: true
with_items:
- gcc
- make
- libssl-dev
- zlib1g-dev
- libpam0g-dev
when: ansible_os_family == "Debian"
- name: get ssh source
shell: wget http://mirror.aarnet.edu.au/pub/OpenBSD/OpenSSH/portable/openssh-{{ ssh_version }}.tar.gz
args:
chdir: /tmp
creates: /tmp/openssh-{{ ssh_version }}.tar.gz
- name: untar ssh
shell: tar zxf /tmp/openssh-{{ ssh_version }}.tar.gz
args:
chdir: /tmp
- name: build ssh
shell: ./configure --prefix={{ ssh_dir }} --with-ipv4-default --with-md5-passwords --with-pam && make
args:
chdir: /tmp/openssh-{{ ssh_version }}
creates: /tmp/openssh-{{ ssh_version }}/ssh
- name: install ssh
shell: make install
sudo: true
args:
chdir: /tmp/openssh-{{ ssh_version }}
creates: "{{ ssh_dir }}/bin/ssh"
- name: copy init script
template: dest=/etc/init.d/{{ sshd_name }} src=ssh.initd.centos.j2 mode=755
sudo: true
when: ansible_os_family == "RedHat"
- name: copy config script
template: dest={{ ssh_dir }}/etc/sshd_config src=sshd_config_centos.j2 mode=644
notify: restart openssh
sudo: true
when: ansible_os_family == "RedHat"
- name: copy init script
template: dest=/etc/init.d/{{ sshd_name }} src=ssh.initd.debian.j2 mode=755
sudo: true
when: ansible_os_family == "Debian"
- name: copy config script
template: dest={{ ssh_dir }}/etc/sshd_config src=sshd_config_debian.j2 mode=644
notify: restart openssh
sudo: true
when: ansible_os_family == "Debian"