0

I need to add existing ssh-key credential to the job template. But there is no parameter in tower api for create credential. reference document https://docs.ansible.com/ansible-tower/latest/html/towerapi/api_ref.html#/Job_Templates/Job_Templates_job_templates_create

I tried as credential list according to some document not a single one worked

async createJobTemplate(job_template: JobTemplate) {
     const data = await this.post("/api/v2/job_templates/", {
         name: job_template.name,
         description: job_template.description,
         organization: job_template.organization_id,
         inventory: job_template.inventory_id,
         project: job_template.project_id,
         playbook: job_template.playbook_name,
         credentials: [job_template.ssh_key_id]
         allow_simultaneous: job_template.concurrent,
         ask_inventory_on_launch: (job_template.inventory_id == "") ? true : false,
});

then single credential

credentials: job_template.ssh_key_id

Can I know an exact method by that credentials can be added to the job template using tower API?

0 Answers0