From 482bbc8cf13c57aaafbb9a9061d95e7a599ce425 Mon Sep 17 00:00:00 2001 From: staticsafe Date: Tue, 25 Sep 2018 20:38:02 -0400 Subject: [PATCH] add turn-off-motd-news role --- .../roles/turn-off-motd-news/files/motd-news | 19 +++++++++++++++++++ .../roles/turn-off-motd-news/tasks/main.yml | 12 ++++++++++++ ubuntu/site.yml | 7 +++++++ 3 files changed, 38 insertions(+) create mode 100644 ubuntu/roles/turn-off-motd-news/files/motd-news create mode 100644 ubuntu/roles/turn-off-motd-news/tasks/main.yml diff --git a/ubuntu/roles/turn-off-motd-news/files/motd-news b/ubuntu/roles/turn-off-motd-news/files/motd-news new file mode 100644 index 0000000..eefe29c --- /dev/null +++ b/ubuntu/roles/turn-off-motd-news/files/motd-news @@ -0,0 +1,19 @@ +# Enable/disable the dynamic MOTD news service +# This is a useful way to provide dynamic, informative +# information pertinent to the users and administrators +# of the local system +ENABLED=0 + +# Configure the source of dynamic MOTD news +# White space separated list of 0 to many news services +# For security reasons, these must be https +# and have a valid certificate +# Canonical runs a service at motd.ubuntu.com, and you +# can easily run one too +URLS="https://motd.ubuntu.com" + +# Specify the time in seconds, you're willing to wait for +# dynamic MOTD news +# Note that news messages are fetched in the background by +# a systemd timer, so this should never block boot or login +WAIT=5 diff --git a/ubuntu/roles/turn-off-motd-news/tasks/main.yml b/ubuntu/roles/turn-off-motd-news/tasks/main.yml new file mode 100644 index 0000000..e665f37 --- /dev/null +++ b/ubuntu/roles/turn-off-motd-news/tasks/main.yml @@ -0,0 +1,12 @@ +--- +# This role turns off the MOTD news in Ubuntu 18.04 + +- name: Copy motd-news file + when: ansible_distribution_release == 'bionic' + copy: + src: motd-news + dest: /etc/default/motd-news + owner: root + group: root + mode: 0644 + backup: yes diff --git a/ubuntu/site.yml b/ubuntu/site.yml index 84e946e..cce1839 100644 --- a/ubuntu/site.yml +++ b/ubuntu/site.yml @@ -36,3 +36,10 @@ - jdauphant.nginx - php - mysql + +- name: Turn off MOTD news on Ubuntu 18.04 hosts + hosts: myubuntuservers + user: root + + roles: + - turn-off-motd-news