Merge pull request 'Rôle pour motd' (#38) from update_motd into master
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Reviewed-on: Aurore/ansible#38pull/39/head
commit
2a6c2b30de
@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
# {{ ansible_managed }}
|
||||
uname -snrvm
|
@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
# {{ ansible_managed }}
|
||||
echo "> prometheus a été déployé sur cette machine."
|
||||
echo " Voir /etc/prometheus/"
|
@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
# {{ ansible_managed }}
|
||||
echo "> prometheus a été déployé sur cette machine."
|
||||
echo " Voir /etc/prometheus/"
|
@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Remove cached motd
|
||||
become: true
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- /var/run/motd.dynamic
|
||||
- /var/run/motd.dynamic.new
|
||||
...
|
@ -0,0 +1,53 @@
|
||||
---
|
||||
- name: Ensure update-motd.d exists
|
||||
become: true
|
||||
file:
|
||||
path: /etc/update-motd.d
|
||||
state: directory
|
||||
mode: u=rwx,g=rx,o=rx
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Customize motd
|
||||
become: true
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
dest: "/etc/update-motd.d/{{ item }}"
|
||||
mode: u=rwx,g=rx,o=rx
|
||||
owner: root
|
||||
group: root
|
||||
loop:
|
||||
- 00-logo
|
||||
- 10-messages
|
||||
- 20-uname
|
||||
notify: Remove cached motd
|
||||
|
||||
- name: Remove Debian warranty motd
|
||||
become: true
|
||||
file:
|
||||
path: /etc/motd
|
||||
state: absent
|
||||
notify: Remove cached motd
|
||||
|
||||
- name: Ensure motd-messages exists
|
||||
become: true
|
||||
file:
|
||||
path: /etc/motd-messages
|
||||
state: directory
|
||||
mode: u=rwx,g=rx,o=rx
|
||||
owner: root
|
||||
group: root
|
||||
notify: Remove cached motd
|
||||
|
||||
- name: Install additional motd messages
|
||||
become: true
|
||||
copy:
|
||||
content: "✨ {{ item.message }}\n"
|
||||
dest: "/etc/motd-messages/{{ item.key }}"
|
||||
mode: u=rwx,g=rx,o=rx
|
||||
owner: root
|
||||
group: root
|
||||
loop: "{{ motd_messages }}"
|
||||
notify: Remove cached motd
|
||||
when: motd_messages is defined
|
||||
...
|
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -euf
|
||||
|
||||
find /etc/motd-messages -type f -exec cat -- {} +
|
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
{{ ansible_managed | comment }}
|
||||
|
||||
uname -snrvm
|
Loading…
Reference in New Issue