Gets error “Cannot get CSRF” when trying to install jenkins-plugin using ANSIBLE

一个人想着一个人 提交于 2019-12-04 13:47:16

You don't seem to wait between starting up jenkins and trying to install the plugin. The jenkins_plugin requires a running and working jenkins installation, so you should do a wait between Start jenkins service and Install build-pipeline:

- name: Wait for Jenkins to start up
  uri:
    url: http://localhost:8080
    status_code: 200
    timeout: 5
  register: jenkins_service_status
  # Keep trying for 5 mins in 5 sec intervals
  retries: 60
  delay: 5
  until: >
     'status' in jenkins_service_status and
     jenkins_service_status['status'] == 200
Muhammad Faizan-Ul-Haq

In order to skip the startup wizard, I found this (offcourse googling)

- name: Jenkins Skip startUp for MI
  lineinfile:
    dest=/etc/sysconfig/jenkins
    regexp='^JENKINS_JAVA_OPTIONS='
    line='JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Djenkins.install.runSetupWizard=false"'
  register: result_skip_startup_wizard
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!