Skip to content

How to generate configs (with iterate over inventory) #104

Answered by umputun
knutov asked this question in Q&A
Discussion options

You must be logged in to vote

You can do it without running the spot twice. It can be done with a "local" command invoking the spot generator, i.e.

task:
 - name: prepare config for the target host
    command: sport --gen --gen.tempate=blah.tmpl --get.output=file.conf --target=$SPOT_REMOTE_NAME
    options: {local: true}
 - name: deploy generate config
    copy: {src: file.conf, dst: /srv/file.conf}

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@umputun
Comment options

@knutov
Comment options

@umputun
Comment options

Answer selected by knutov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants