Unable to install jenkins from ansible -


i want automate installation of jenkins , using ansible. trying install jenkins repo , gpg key. playbook

--- - hosts: "{{ host }}"   become: true   become_user: root   gather_facts: true   become_method: sudo    vars:     temp_folder: /tmp    tasks:     - name: include variables       include_vars:         dir: '../vars'         extensions: ['yml']      - name: install java         yum:             name: java             state: present             update_cache: yes       become: true       become_user: root      - name: add jenkins repository | add sources list       yum_repository:         name: jenkins         description: jenkins         baseurl: "{{ jenkins_repo }}"         gpgkey: "{{ jenkins_key }}"         gpgcheck: yes       become: true       become_user: root      - name: install jenkins        yum:         name: jenkins         state: present             update_cache: yes       become_user : root       become: true      - name: start jenkins service | enable on boot       service:         name: jenkins         state: started         enabled: yes       become: true       become_user: root 

the values in var file contains following keys:- ---

jenkins_key: https://pkg.jenkins.io/redhat/jenkins.io.key jenkins_repo: https://pkg.jenkins.io/redhat/jenkins.repo 

now when executing playbook throwing me following error.

fatal: [atul-ec2]: failed! => {     "changed": false,      "failed": true,      "invocation": {         "module_args": {             "conf_file": null,              "disable_gpg_check": false,              "disablerepo": null,              "enablerepo": null,              "exclude": null,              "install_repoquery": true,              "installroot": "/",              "list": null,              "name": [                 "jenkins"             ],              "skip_broken": false,              "state": "present",              "update_cache": true,              "validate_certs": true         }     },      "msg": "failure talking yum: failure: repodata/repomd.xml jenkins: [errno 256] no more mirrors try.\nhttps://pkg.jenkins.io/redhat/jenkins.repo/repodata/repomd.xml: [errno 14] https error 404 - not found" } 

but when trying add jenkins repo manually not throwing me error.

the baseurl parameter supposed contain value pointing url containing packages , repodata. value supplied file containing yum repo information. need pull baseurl file , use value. in example of redhat, value should be:

jenkins_repo: https://pkg.jenkins.io/redhat/ 

the repo configured using repodata/repomod.xml contained in directory when jenkins_repo variable used baseurl parameter using in yum_repository module in task.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -