diff --git a/tasks/configure_motd.yml b/tasks/configure_motd.yml deleted file mode 100644 index 1e8b8cf..0000000 --- a/tasks/configure_motd.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: configure_motd | Apply template {{ motd_template }} on {{ _motd_file_path }} - ansible.builtin.copy: - content: "{{ motd_template_prepend + _motd_template_content + motd_template_append }}" - dest: "{{ _motd_file_path }}" - owner: root - group: root - mode: '0755' - tags: - - molecule-idempotence-notest - -- name: configure_motd | Add pam_exec {{ _motd_file_path }} in pam - ansible.builtin.lineinfile: - path: "{{ item }}" - line: session optional pam_exec.so type=open_session stdout {{ _motd_file_path }} - loop: - - "{{ _motd_pam_login_file_path }}" - - "{{ _motd_pam_sshd_file_path }}" -... diff --git a/tasks/main.yml b/tasks/main.yml index 6fb1c92..1dd5b3f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,6 +3,21 @@ ansible.builtin.include_tasks: disable_default_motd.yml when: motd_disable_default_motd|bool -- name: Include configure_motd.yml - ansible.builtin.include_tasks: configure_motd.yml +- name: configure_motd | Apply template {{ motd_template }} on {{ _motd_file_path }} + ansible.builtin.copy: + content: "{{ motd_template_prepend + _motd_template_content + motd_template_append }}" + dest: "{{ _motd_file_path }}" + owner: root + group: root + mode: '0755' + tags: + - molecule-idempotence-notest + +- name: configure_motd | Add pam_exec {{ _motd_file_path }} in pam + ansible.builtin.lineinfile: + path: "{{ item }}" + line: session optional pam_exec.so type=open_session stdout {{ _motd_file_path }} + loop: + - "{{ _motd_pam_login_file_path }}" + - "{{ _motd_pam_sshd_file_path }}" ...