小编Muh*_*Haq的帖子

尝试使用 ANSIBLE 安装 jenkins-plugin 时出现错误“无法获取 CSRF”

我正在使用 ANSIBLE 在 CENTOS 上安装 jenkins。安装工作正常,但是当涉及到安装插件的任务时,我收到以下错误。

fatal: [jenkins]: FAILED! => {"changed": false, "details": "Request failed: <urlopen error [Errno 111] Connection refused>", "failed": true, "msg": "Cannot get CSRF"}
Run Code Online (Sandbox Code Playgroud)

代码如下。

- name: Install jenkins 
rpm_key:
state: present
key: https://pkg.jenkins.io/redhat-stable/jenkins.io.key

- name: Add Repository for jenkins
  yum_repository:
    name: jenkins
    description: Repo needed for automatic installation of Jenkins
    baseurl: http://pkg.jenkins.io/redhat-stable
    gpgcheck: yes
    gpgkey: https://pkg.jenkins.io/redhat-stable/jenkins.io.key

    #Pre requisite: add key and repo
- name: Install jenkins
  yum:
    name: jenkins
    state: present

#Start/Stop jenkins
- name: Start …
Run Code Online (Sandbox Code Playgroud)

csrf jenkins jenkins-plugins ansible

6
推荐指数
1
解决办法
6094
查看次数

标签 统计

ansible ×1

csrf ×1

jenkins ×1

jenkins-plugins ×1