Giter VIP home page Giter VIP logo

ansible-role-systemd-service's Introduction

Build Status Ansible Galaxy

systemd-service - Ansible role

Register services to systemd.

Japanese ver http://qiita.com/tumf/items/9d5ac6853685ba53214d

Install

$ ansible-galaxy install tumf.systemd-service

Role Variables

name type default description
systemd_service_default_dir String "/etc/default" envs file path
systemd_service_systemd_dir String "/etc/systemd/system" systemd path
systemd_service_name * String service name
systemd_service_envs String,List,MapList [] envs (/etc/default/:name)

Note systemd_service_root_dir is obsolate.

[Unit]

name type default description
systemd_service_Unit_Description String [Unit]Description
systemd_service_Unit_Documentation String [Unit]Documentation
systemd_service_Unit_Requires String,List [Unit]Requires
systemd_service_Unit_Wants String,List [Unit]Wants
systemd_service_Unit_ConditionPathExists String [Unit]ConditionPathExists
systemd_service_Unit_After String,List [Unit]After
systemd_service_Unit_Before String,List [Unit]Before

[Service]

name type default description
systemd_service_Service_Type String "simple" [Service]Type
systemd_service_Service_ExecStartPre String,List [Service]ExecStartPre
systemd_service_Service_ExecStart * String [Service]ExecStart
systemd_service_Service_ExecStartPost String,List [Service]ExecStartPost
systemd_service_Service_Restart String "no" [Service]Restart "no" or "always" or "on-success" or "on-failure"
systemd_service_Service_RestartSec Integer [Service]RestartSec
systemd_service_Service_ExecReload String [Service]ExecReload
systemd_service_Service_ExecStop String [Service]ExecStop
systemd_service_Service_KillMode String [Service]KillMode
systemd_service_Service_ExecStopPost String,List [Service]ExecStopPost
systemd_service_Service_PIDFile String [Service]PIDFile
systemd_service_Service_BusName String [Service]BusName
systemd_service_Service_PrivateTmp String [Service]PrivateTmp
systemd_service_Service_User String [Service]User
systemd_service_Service_Group String [Service]Group
systemd_service_Service_WorkingDirectory String [Service]WorkingDirectory

[Install]

name type default description
systemd_service_Install_WantedBy String [Install]WantedBy "multi-user.target" [Install]WantedBy
systemd_service_Install_RequiredBy String [Install]RequiredBy
systemd_service_Install_Also String [Install]Also
systemd_service_Install_Alias String [Install]Alias
  • Required

Example Playbook

- hosts: servers
  roles:
    - role: systemd-service
      systemd_service_name: "swarm-manager"
      systemd_service_envs:
          - "DOCKER_HOST=tcp://127.0.0.1:2375"
      systemd_service_Unit_Description: Docker Swarm Manager
      systemd_service_Unit_Requires: docker.service
      systemd_service_Unit_After: docker.service
      systemd_service_Service_ExecStartPre:
          - -/usr/bin/docker stop swarm-manager
          - -/usr/bin/docker rm swarm-manager
          - /usr/bin/docker pull swarm
      systemd_service_Service_ExecStart: /usr/bin/docker run -p 2377:2375 --name swarm-manager swarm manage

License

MIT

Author Information

@tumf

ansible-role-systemd-service's People

Contributors

ch-tactica avatar h3po avatar johngoldfinger avatar pfink avatar talset avatar tkhduracell avatar tumf avatar vkill avatar

Watchers

 avatar  avatar

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.