community.general.nomad_job module – Launch a Nomad Job
Note
This module is part of the community.general collection (version 4.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.nomad_job
.
New in version 1.3.0: of community.general
Parameters
Parameter |
Comments |
---|---|
Path of certificate for TLS/SSL. |
|
Path of certificate’s private key for TLS/SSL. |
|
Content of Nomad job. Either this or name must be specified. |
|
Type of content of Nomad job. Choices:
|
|
Force job to started. Choices:
|
|
FQDN of Nomad server. |
|
Name of job for delete, stop and start job without source. Name of job for delete, stop and start job without source. Either this or content must be specified. |
|
Namespace for Nomad. |
|
Deploy or remove job. Choices:
|
|
Timeout (in seconds) for the request to Nomad. Default: 5 |
|
ACL token for authentification. |
|
Use TLS/SSL connection. Choices:
|
|
Enable TLS/SSL certificate validation. Choices:
|
See Also
See also
- Nomad jobs documentation
Complete documentation for Nomad API jobs.
Examples
- name: Create job
community.general.nomad_job:
host: localhost
state: present
content: "{{ lookup('ansible.builtin.file', 'job.hcl') }}"
timeout: 120
- name: Stop job
community.general.nomad_job:
host: localhost
state: absent
name: api
- name: Force job to start
community.general.nomad_job:
host: localhost
state: present
name: api
timeout: 120
force_start: true
Authors
FERREIRA Christophe (@chris93111)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication