2018-08-25 23:39:06 +02:00
|
|
|
---
|
|
|
|
- name: Set OS dependent variables
|
2019-06-04 11:43:42 +02:00
|
|
|
include_vars: "{{ lookup('first_found', params) }}"
|
2018-09-08 10:13:51 +02:00
|
|
|
vars:
|
2019-06-04 11:43:42 +02:00
|
|
|
ansible_distribution_lts_offset: >-
|
|
|
|
{{
|
|
|
|
ansible_distribution_major_version|int % 2
|
|
|
|
if ansible_distribution == "Ubuntu"
|
|
|
|
else 0
|
|
|
|
}}
|
2019-09-30 19:57:15 +02:00
|
|
|
ansible_distribution_lts_version: >-
|
|
|
|
{{
|
|
|
|
ansible_distribution_major_version|int -
|
|
|
|
ansible_distribution_lts_offset|int
|
|
|
|
if ansible_distribution == "Ubuntu"
|
|
|
|
else ansible_distribution_version
|
|
|
|
}}
|
2019-06-04 11:43:42 +02:00
|
|
|
params:
|
|
|
|
files:
|
2019-02-25 21:45:15 +01:00
|
|
|
- "{{ ansible_distribution }}_{{ ansible_distribution_lts_version }}.yml"
|
|
|
|
- "{{ ansible_distribution }}.yml"
|
2019-10-03 15:07:16 +02:00
|
|
|
- "{{ ansible_os_family }}_{{ ansible_distribution_version }}.yml"
|
2019-02-25 21:45:15 +01:00
|
|
|
- "{{ ansible_os_family }}.yml"
|
|
|
|
- default.yml
|
|
|
|
paths:
|
|
|
|
- '{{ role_path }}/vars'
|
|
|
|
- '{{ playbook_dir }}/vars'
|
2018-08-25 23:39:06 +02:00
|
|
|
|
|
|
|
- name: Override OS defaults
|
|
|
|
block:
|
2019-05-23 19:31:30 +02:00
|
|
|
- name: Define sshd_packages
|
|
|
|
set_fact:
|
2018-08-25 23:39:06 +02:00
|
|
|
sshd_packages: "{{ __sshd_packages }}"
|
|
|
|
when: sshd_packages is not defined
|
2019-05-23 19:31:30 +02:00
|
|
|
- name: Define sshd_config_owner
|
|
|
|
set_fact:
|
2018-08-25 23:39:06 +02:00
|
|
|
sshd_config_owner: "{{ __sshd_config_owner }}"
|
|
|
|
when: sshd_config_owner is not defined
|
2019-05-23 19:31:30 +02:00
|
|
|
- name: Define sshd_config_group
|
|
|
|
set_fact:
|
2018-08-25 23:39:06 +02:00
|
|
|
sshd_config_group: "{{ __sshd_config_group }}"
|
|
|
|
when: sshd_config_group is not defined
|
2019-05-23 19:31:30 +02:00
|
|
|
- name: Define sshd_config_mode
|
|
|
|
set_fact:
|
2018-08-25 23:39:06 +02:00
|
|
|
sshd_config_mode: "{{ __sshd_config_mode }}"
|
|
|
|
when: sshd_config_mode is not defined
|
2019-05-23 19:31:30 +02:00
|
|
|
- name: Define sshd_config_file
|
|
|
|
set_fact:
|
2018-08-25 23:39:06 +02:00
|
|
|
sshd_config_file: "{{ __sshd_config_file }}"
|
|
|
|
when: sshd_config_file is not defined
|
2019-05-23 19:31:30 +02:00
|
|
|
- name: Define sshd_binary
|
|
|
|
set_fact:
|
2018-08-25 23:39:06 +02:00
|
|
|
sshd_binary: "{{ __sshd_binary }}"
|
|
|
|
when: sshd_binary is not defined
|
2019-05-23 19:31:30 +02:00
|
|
|
- name: Define sshd_service
|
|
|
|
set_fact:
|
2018-08-25 23:39:06 +02:00
|
|
|
sshd_service: "{{ __sshd_service }}"
|
|
|
|
when: sshd_service is not defined
|
2019-05-23 19:31:30 +02:00
|
|
|
- name: Define sshd_sftp_server
|
|
|
|
set_fact:
|
2018-08-25 23:39:06 +02:00
|
|
|
sshd_sftp_server: "{{ __sshd_sftp_server }}"
|
|
|
|
when: sshd_sftp_server is not defined
|