I want to automate installation of jenkins and for that i am using ansible.
I am trying to install jenkins with its repo and gpg key. This is my 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 i am executing playbook it 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 to yum: failure: repodata/repomd.xml from jenkins: [Errno 256] No more mirrors to try.\nhttps://pkg.jenkins.io/redhat/jenkins.repo/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found"
}

```

But when i am trying to add jenkins repo manually it is not throwing me any error.