Is it possible to specify AWX job id from which AWX will start incrementing for subsequent runs.... please share your thoughts

136 views
Skip to first unread message

Kannan Somaiah

unread,
Nov 3, 2022, 4:40:33 AM11/3/22
to AWX Project
Is it possible to specify AWX job id from which AWX will start incrementing for subsequent runs.... please share your thoughts

AWX Project

unread,
Nov 4, 2022, 1:40:27 PM11/4/22
to AWX Project
sorry no this is not possible

Is there a particular need for this?

AWX Team

Manikandan Balasubramanian

unread,
Nov 4, 2022, 6:02:17 PM11/4/22
to awx-p...@googlegroups.com
For some reason, If you want to know the AWX job id itself, you can assign the job id as an environment variable in your pod spec: something like this:

          env:
          - name: job_id
            valueFrom:
              fieldRef:
                fieldPath: metadata.labels['ansible-awx-job-id']

And in your ansible playbook, you can reference this job_id variable to get the AWX job id that the pod was assigned.

Thanks and Regards,
Mani


--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/93fcebc1-3e6b-477d-8dff-ffca489502a9n%40googlegroups.com.

Howard Jones

unread,
Nov 4, 2022, 6:29:26 PM11/4/22
to awx-p...@googlegroups.com
On 04/11/2022 22:02, Manikandan Balasubramanian wrote:
> For some reason, If you want to know the AWX job id itself, you can
> assign the job id as an environment variable in your pod spec:
> something like this:
>
>           env:
>           - name: job_id
>             valueFrom:
>               fieldRef:
>                 fieldPath: metadata.labels['ansible-awx-job-id']
>
> And in your ansible playbook, you can reference this job_id variable
> to get the AWX job id that the pod was assigned.
You don't even need to do that "{{ tower_job_id }}" (and I would guess
awx_job_id) are already defined.

(you can also use "when: tower_job_id is defined" to have tasks that
only run when you are running from awx and not locally)

Kannan Somaiah

unread,
Nov 12, 2022, 11:39:48 AM11/12/22
to awx-p...@googlegroups.com
Hi,

Thanks for your reply. Yes we have a requirement where it will be better if we can specify from where the job id should start.


--
Reply all
Reply to author
Forward
0 new messages