Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi,
- I was trying to deploy jenkins using ansible playbooks as a part of learning and I was using "get_url" module to "add the repository key to the system (remote machine)" but when I execute its throws me an error which is
- >>>>>>>>>. HTTP Error 400: Bad Request", "state": "absent", "status_code": 400, "url<<<<<
- Please suggest what to do with this error.
- Anisble script:
- --
- - name: deploying jenkins on target machine
- hosts: dbU1
- gather_facts: yes
- #become_user: root
- #become_method: root
- tasks:
- - name: update the apt repo
- apt:
- update_cache: yes
- cache_valid_time: 8600
- become: yes
- #when: ansible_facts['os_family'] == "Debian"
- - name: Installing the dependience on dbU1
- apt:
- name: "{{ item }}"
- state: latest
- with_items:
- - openjdk-8-jdk
- - wget
- become: yes
- - name: add the repository key to the system dbU1
- get_url:
- url: https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add
- dest: var/lib/
- [ansadmctrl@ip-xxx-xx-xx-xx ex3]$ ansible-playbook -i inven-dev jenkins.yml -K
- SUDO password:
- PLAY [deploying jenkins on target machine (Web & db)] ************************************************************************************************
- TASK [Gathering Facts] *******************************************************************************************************************************
- ok: [dbU1]
- TASK [update the apt repo] ***************************************************************************************************************************
- ok: [dbU1]
- TASK [Installing the prerequisites on dbU1] **********************************************************************************************************
- [DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items
- and specifying `name: "{{ item }}"`, please use `name: ['openjdk-8-jdk', 'wget']` and remove the loop. This feature will be removed in version 2.11.
- Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
- ok: [dbU1] => (item=[u'openjdk-8-jdk', u'wget'])
- TASK [add the repository key to the system dbU1] *****************************************************************************************************
- fatal: [dbU1]: FAILED! => {"changed": false, "dest": "var/lib/", "msg": "Request failed", "response": "HTTP Error 400: Bad Request", "state": "absent", "status_code": 400, "url": "https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add"}
- to retry, use: --limit @/home/ansadmctrl/ansible/ex3/jenkins.retry
- PLAY RECAP *******************************************************************************************************************************************
- dbU1 : ok=3 changed=0 unreachable=0 failed=1
Add Comment
Please, Sign In to add comment