Remove banner reference
This commit is contained in:
parent
dbf4d327cf
commit
cf7e3da48e
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
###VSCode###
|
||||
.vscode
|
||||
###MacOS###
|
||||
.DS_Store
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
---
|
||||
motd_disable_default_motd: true
|
||||
motd_banner_template: https://raw.githubusercontent.com/claranet/motd/master/banner
|
||||
motd_template: https://raw.githubusercontent.com/claranet/motd/master/scripts/00-basic
|
||||
motd_banner_template_prepend: ""
|
||||
motd_banner_template_append: ""
|
||||
motd_template_prepend: ""
|
||||
motd_template_append: |
|
||||
|
||||
@ -13,5 +10,3 @@ motd_template_append: |
|
||||
|
||||
motd_template_username: ""
|
||||
motd_template_password: ""
|
||||
motd_banner_template_username: "{{ motd_template_username }}"
|
||||
motd_banner_template_password: "{{ motd_template_password }}"
|
||||
|
@ -3,7 +3,6 @@
|
||||
hosts: all
|
||||
roles:
|
||||
- role: claranet.motd
|
||||
motd_banner_template: null
|
||||
|
||||
pre_tasks:
|
||||
- name: "Update APT cache"
|
||||
|
@ -12,11 +12,6 @@ motd_file_path = "/usr/local/bin/dynmotd"
|
||||
pam_line = f"session optional pam_exec.so type=open_session stdout {motd_file_path}"
|
||||
|
||||
|
||||
def test_banner_file(host):
|
||||
file = host.file("/etc/banner")
|
||||
assert not file.exists
|
||||
|
||||
|
||||
def test_motd_file(host):
|
||||
file = host.file(motd_file_path)
|
||||
assert file.exists
|
||||
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
- name: configure_banner | Apply template {{ motd_banner_template }} on {{ _motd_banner_file_path }}
|
||||
copy:
|
||||
content: "{{ motd_banner_template_prepend + _motd_banner_template_content + motd_banner_template_append }}"
|
||||
dest: "{{ _motd_banner_file_path }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
when: motd_banner_template != None and motd_banner_template|length>0
|
||||
|
||||
- name: configure_banner | Ensure line "Banner {{ _motd_banner_file_path }}" is {{ _motd_banner_state }} in {{ _motd_sshd_config_file_path }}
|
||||
lineinfile:
|
||||
path: "{{ _motd_sshd_config_file_path }}"
|
||||
regexp: "^(#?)Banner "
|
||||
line: Banner {{ _motd_banner_file_path }}
|
||||
state: "{{ _motd_banner_state }}"
|
||||
notify: Restart sshd
|
||||
...
|
@ -1,6 +1,4 @@
|
||||
---
|
||||
- include_tasks: configure_banner.yml
|
||||
|
||||
- name: include_tasks disable_default_motd.yml if motd_disable_default_motd is True
|
||||
include_tasks: disable_default_motd.yml
|
||||
when: motd_disable_default_motd|bool
|
||||
|
@ -2,10 +2,6 @@
|
||||
_motd_sshd_config_file_path: /etc/ssh/sshd_config
|
||||
_motd_pam_login_file_path: /etc/pam.d/login
|
||||
_motd_pam_sshd_file_path: /etc/pam.d/sshd
|
||||
_motd_banner_file_path: /etc/banner
|
||||
_motd_banner_state: "{{ 'present' if motd_banner_template else 'absent' }}"
|
||||
_motd_file_path: /usr/local/bin/dynmotd
|
||||
_motd_lookup_method: "{{ 'url' if motd_template is match('http(s)?:\/\/') else 'template' }}"
|
||||
_motd_template_content: "{{ lookup(_motd_lookup_method, motd_template, split_lines=False, username=motd_template_username, password=motd_template_password) }}"
|
||||
_motd_banner_lookup_method: "{{ 'url' if motd_banner_template is match('http(s)?:\/\/') else 'template' }}"
|
||||
_motd_banner_template_content: "{{ lookup(_motd_banner_lookup_method, motd_banner_template, split_lines=False, username=motd_banner_template_username, password=motd_banner_template_password) }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user