$ ansible --version
ansible 2.3.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.14 (default, Oct  2 2017, 09:52:26) [GCC 4.2.1
Compatible OpenBSD Clang 4.0.0 (tags/RELEASE_400/final)]


I'm working on a role to manage NTP client setup on target hosts and
am confused about how to handle something. On recent Debian Linux
hosts, systemd is the service manager. I want to run the OpenNTPD
daemon with the "-s" argument, so in the task I add it in the
arguments parameter as shown below:

- name: enable ntp service
  service:
    name: '{{ ntpd_service_name }}'
    enabled: '{{ ntpd_service_enabled }}'
    state: '{{ ntpd_service_state }}'
    arguments: '{% if ntpd_step_time %}-s{%endif %}'
    use: '{{ ntpd_service_mgr }}'
  tags: [ntp]

When the task runs it notes that systemd does not use the arguments parameter:

TASK [ntp_client : enable ntp service]
******************************************************************************
 [WARNING]: Ignoring "arguments" as it is not used in "systemd"

Indeed:

$ pgrep -a ntpd
10673 /usr/sbin/ntpd -f /etc/openntpd/ntpd.conf

Is there a way for the systemd module to support configuring a service
to use supplied arguments? It's possible to configure it by modifying
DAEMON_OPTS in /etc/default/openntpd using another task, but that
seems wrong when the service module documents the arguments parameter
as handling it.

-- 
Darren Spruell
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKVSOJXbMZpyU9t6n_EctP8JCDJKGrRMeyfvhTWVZC%2Beooywhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to