ansible-role-bastille icon indicating copy to clipboard operation
ansible-role-bastille copied to clipboard

Provides optional args to a Bastille template

Open psmet-dev opened this issue 4 years ago • 2 comments

As template command allows to parse args from the command line, this would give the possibility to provide values from ansible to configure the jail.

psmet-dev avatar Aug 26 '21 20:08 psmet-dev

Thanks so much for the PR.

This is definitively a planned feature. As args are per template, its implementation needs to reflect that. So I was thinking the structure like this (ideas are welcome):

      bastille_jails:
        - name: defaultjail
          release: 13.0-RELEASE
          ip: 10.17.89.1
          templates:
            - template: "yaazkal/bastille-postgres"
              args:
                - version: 12
            - template: "yaazkal/bastille-matomo"
              args:
                - version: 2
                - other: yes
                - user: whatever

Edit: I need to check if the word args con be used in this context due to ansible args, but I hope it clarifies the idea.

yaazkal avatar Aug 26 '21 21:08 yaazkal

I've made some changes based on your proposal which is indeed better. Each template should now be applied separately with its own args. I've kept the args as strings as I didn't find how to convert an array of items to a string while already in a loop.

psmet-dev avatar Aug 27 '21 18:08 psmet-dev