Coder Social home page Coder Social logo

ansible-role-systemd-service's People

Contributors

anasbouzid avatar debackerl avatar gregzuro avatar merifri avatar stuehmer avatar thtong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-systemd-service's Issues

ExecReload does not format multiple instances correctly

In the service template as shown below, the ExecReload in the for loop should reference exec_reload instead of the given array.

{% if systemd_service[item].exec_reload is defined %}
{% if systemd_service[item].exec_reload is not string %}
{% for exec_reload in systemd_service[item].exec_reload -%}
ExecReload={{ systemd_service[item].exec_reload }}
{% endfor %}
{% else %}
ExecReload={{ systemd_service[item].exec_reload }}
{% endif -%}
{% endif -%}

Correct format:

{% if systemd_service[item].exec_reload is defined %}
{% if systemd_service[item].exec_reload is not string %}
{% for exec_reload in systemd_service[item].exec_reload -%}
ExecReload={{ exec_reload }}
{% endfor %}
{% else %}
ExecReload={{ systemd_service[item].exec_reload }}
{% endif -%}
{% endif -%}

User Service support

Hello,

First of all, thank you for this project!

I would like to request that user services are supported.
I am starting to work with rootless Podman and would like to use your role to create my service definitions.

I think all that would be needed is to specify the user systemd location for the service file rather than /etc and to do a user side daemon-reload.

service doesn't run because "Failed to parse service restart specifier, ignoring: False"

The following role invocation using Ansible 2.9.10 on Debian Stretch controller:

- name: >
    Install systemd service unit to generate /dev/loop nodes on startup.
    (rc.local is disabled in Debian Buster in lieu of systemd.)
  become: true
  hosts: engineering_services_jenkins_cluster
  vars:
    - systemd_service:
        create-loop-devices:
          description: Oneshot service unit to create loop devices at boot.
          enabled: Yes
          exec_start: "/bin/bash -lc '/usr/local/bin/create-loop-devices.sh'"
          user: root
          group: root
          type: oneshot
          restart: no
  roles:
    - role: cimon-io.systemd_service

Results in the following service unit on the controlled (Debian Buster) machine:

[Unit]
Description="Oneshot service unit to create loop devices at boot."

[Service]
Type=oneshot
RestartSec=30
Restart=False
User=root
Group=root
ExecStart=/bin/bash -lc '/usr/local/bin/create-loop-devices.sh'

which results in the following syslog entry in the controlled machine:

systemd[1]: /etc/systemd/system/create-loop-devices.service:6: Failed to parse service restart specifier, ignoring: False

Expected behavior is that the default "restart: no" would result in a valid "restart" setting in the systemd service file. The man page says that Restart:

Takes one of no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, or always.

As a test, I changed my role to not specify a "restart" parameter, and then, and only then did my service actually run.

CentOS/RHEL support

Your syntax is much nicer than the tumf version. We have some CentOS 7 boxes so it'd be nice to have support for that. :-)

You forgot fedora!

Kind of cruel to forget one of the major players in systemd. I know, it's trivial to fix. Just thought I'd mention it. But I must congratulate you on the work you did to make this work. It's a major job. I will try it soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.