Skip to content

pors api

TF edited this page Feb 4, 2021 · 6 revisions

About

The deploy action (--action deploy) is in use since years so can be considered as 'stable'.
Anything else is under WIP so should be used with care.

Features

The following is a snapshot of the current features - better use ./pors --help to see the most current:

    Batch / API mode: !!!WORK-IN-PROGRESS!!!
    ------------------------------------------
    Enables full automated way of using PORS

    --batch

     MANDATORY:

       --env <environment>                      define the running environment (/opt/pors_data/inventories/[your --env setting]/, e.g. production or development, ...)
       -i|--inventory <hosts-file>              The full path to your hosts filename
       -t|--target <targetgroup>                The group name as defined in your inventory

       ACTION OR PLAYBOOK OR FUNCTION (MANDATORY)

       -p|--play <playbookname>                 available playbooks are in ./playbooks
         [--playargs "<arguments>"]             optional variables for the given playbook. must be defined as key=value.

       OR
       -f|--function <function>                 interal pors function name (e.g. F_ADDPEER)
         [--funcargs "<arguments>"              optional parameters for the given function

       OR
       -a|--action <predefined action>          current predefined actions are:
                                                - deploy

     OPTIONAL:

       -pa|--post-action <post-action>          The action will be performed on the defined <targetgroup> and the current predefined post-actions are: 
                                                reload-all (like a debug refresh)
                                                DS-reload (reload deploy-server on a deploymentserver)
                                                MN-apply-cb (apply cluster-bundle on a masternode)
                                                SHC-apply-cb (apply shcluster-bundle on a deployer)
       --vault-password-file <secret-file>      If you are using Ansible Vault this setting allows to specify a local file containing the
                                                secret to unlock your vault. This is of course a SECURITY ISSUE but if you using vault vars in your playbooks then
                                                ensure that the file permissions of <secret-file> are as restrictive as possible
       -1                                       will force to use ansible v1 as v2 is default
       --deployapp "<app name(s)>"              QUOTED list separated by a PIPE (|) of app names to deploy - if you do *not* want to deploy ALL apps for a target!
                                                This quoted list is egrep regex so may match unwanted things if not being careful.
                                                Example:
                                                If you set --deployapp "my-app|my-other-app" it will match my-app and my-other-app - but also my-app-bla, my-apps, etc
                                                If you want to ensure that only the name "my-app" matches use the $ char at the end: like --deployapp "my-app$|my-other-app"