Uberspace / paternoster

Paternoster allows you to run Ansible playbooks like ordinary Python or Bash scripts.
Other
122 stars 4 forks source link

add "one of group must be given" arguments #19

Closed luto closed 6 years ago

luto commented 6 years ago

Add argument groups of which at least one must be given (e.g. --webserver or --mailserver when adding a domain).

- hosts: paternoster
  vars:
    description: Do something
    parameters:
      - name: webserver
        short: d
        action: store_true
      - name: mailserver
        short: q
        action: store_true
    required_one_of:
      - - webserver
        - mailserver

(just like ansible http://mobygeek.net/blog/2016/02/16/ansible-module-development-parameters/)