Git Product home page Git Product logo

ansible-role-jenkins2's People

Contributors

haidaram avatar karlmdavis avatar kremers avatar prabjohns-atex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ansible-role-jenkins2's Issues

YUM packages not actually updated

Even though the role uses state: latest when installing the Jenkins YUM package, the package isn't updated.

After some research, it appears that what's happening is that the YUM cache isn't being updated first, so YUM doesn't know that there are newer packages to grab. Oops.

While I'm fixing this, it's probably worth adding an option to disable the auto-update, too, since I now provide that option for plugins.

TASK [karlmdavis.jenkins2 : Add Jenkins APT Repository Failure

ansible 2.4.0.0
python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
Vagrant 2.0.1
mac 10.13.1
ubuntu 16.04
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

**provisioning with vagrant ansible causes the following failure:

TASK [karlmdavis.jenkins2 : include_tasks] *************************************
included: /Users/cbrownroberts/Dev/UML-Assets/scripts/libweb-initial-setup/LibWeb/provision/ansible/roles/karlmdavis.jenkins2/tasks/packages_Debian.yml for libweb

TASK [karlmdavis.jenkins2 : Update APT Cache] **********************************
ok: [libweb]

TASK [karlmdavis.jenkins2 : Install OS Dependencies] ***************************
ok: [libweb] => (item=[u'apt-transport-https'])

TASK [karlmdavis.jenkins2 : Determine APT Key and Repo to Use (Step 1)] ********
ok: [libweb]

TASK [karlmdavis.jenkins2 : Determine APT Key and Repo to Use (Step 2)] ********
ok: [libweb]

TASK [karlmdavis.jenkins2 : Add Jenkins APT Key] *******************************
changed: [libweb]

TASK [karlmdavis.jenkins2 : Remove Unused Jenkins APT Repositories] ************
ok: [libweb] => (item=deb http://pkg.jenkins-ci.org/debian binary/)
skipping: [libweb] => (item=deb https://pkg.jenkins.io/debian binary/)
ok: [libweb] => (item=deb https://pkg.jenkins.io/debian-stable binary/)

TASK [karlmdavis.jenkins2 : Add Jenkins APT Repository] ************************
fatal: [libweb]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to 127.0.0.1 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File "/tmp/ansible_LlFLZj/ansible_module_apt_repository.py", line 556, in \r\n main()\r\n File "/tmp/ansible_LlFLZj/ansible_module_apt_repository.py", line 544, in main\r\n cache.update()\r\n File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 456, in update\r\n raise FetchFailedException()\r\napt.cache.FetchFailedException\r\n", "msg": "MODULE FAILURE", "rc": 0}
to retry, use: --limit @/Users/cbrownroberts/Dev/UML-Assets/scripts/libweb-initial-setup/LibWeb/provision/ansible/playbook.retry

PLAY RECAP *********************************************************************
libweb : ok=13 changed=2 unreachable=0 failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Support for RHEL/CentOS 7

Hello - Thanks for creating and open sourcing this role. Is there any interest in supporting RHEL/CentOS 7? I can take a stab at working on it.

Restart Service 'Jenkins' fails: 'TaskInclude' object has no attribute 'has_triggered'

The role fails with Ansible 2.1.0.0 because the handler Restart Service 'Jenkins' fails with the message ERROR! Unexpected Exception: 'TaskInclude' object has no attribute 'has_triggered'

Trace information:

.....
TASK [karlmdavis.jenkins2 : Configure JVM Arguments] ***************************
changed: [52.51.225.109]

RUNNING HANDLER [karlmdavis.jenkins2 : Restart Service 'jenkins'] **************
ERROR! Unexpected Exception: 'TaskInclude' object has no attribute 'has_triggered'
to see the full traceback, use -vvv

Ansible is installed as follows, and has the following version:

$ sudo apt-add-repository ppa:ansible/ansible -y
$ sudo apt-get update
$ sudo apt-get install ansible
$ ansible --version
ansible 2.1.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

After manual restart, when I run your playbook again, it gives me the following error:

TASK [karlmdavis.jenkins2 : Verify CLI] ****************************************
task path: /etc/ansible/roles/karlmdavis.jenkins2/tasks/cli_config.yml:94
fatal: [52.51.225.109]: FAILED! => {"failed": true, "msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user. For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}

Which seems to be related to ansible 2.1 security changes: https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user

When setting allow_world_readable_tmpfiles = True in /etc/ansible/ansible.cfg, the playbook continues until the handler is triggered again and fails with ERROR! Unexpected Exception: 'TaskInclude' object has no attribute 'has_triggered

Resolve Jenkins security warnings

After a clean install, this role leaves Jenkins configured in such a way that there are warnings about several not-recommended security settings:

  • CLI remoting is enabled
  • deprecated agent protocols are enabled
  • agent-master access control is disabled
  • CSRF is disabled

Switch to jenkins_script instead of Jenkins CLI

Recent Ansible releases provide a credible jenkins_script module that -- on the whole -- looks like a more robust solution than this role's current usage of the Jenkins CLI. It'd also lead to somewhat more readable code, which is nice.

Rework HTTP proxy support

If Jenkins is running in a restricted/whitelisted-sites-only proxy server environment, and also points at a custom YUM repo, there may also be a need to not use the proxy server for those YUM connections.

This is kind of an obscure edge case, but one that I'm running into right now. So.

Add support for timeout installing plugins

jenkins_plugin supports a timeout, which is sometimes necessary if the plugin install is slow.

failed: [QAE-BND-001] (item=workflow-aggregator) => {"changed": false, "details": "Connection failure: timed out", "item": "workflow-aggregator", "msg": "Cannot install plugin."}
Changed plugins.yml to be:

- name: Install Plugins
  jenkins_plugin:
    name: "{{ item }}"
    state: present
    jenkins_home: "{{ jenkins_home }}"
    url: "{{ jenkins_url_local }}"
    params:
      url_username: "{{ jenkins_dynamic_admin_username | default(omit) }}"
    url_password: "{{ jenkins_dynamic_admin_password | default(omit) }}"
    validate_certs: "{{ false if ansible_distribution_release == 'trusty' else true }}"
    timeout: 120
  with_items:
    - "{{ jenkins_plugins_recommended }}"
    - "{{ jenkins_plugins_extra }}"
  become: true
  notify:
    - "Restart Service 'jenkins'"

- name: Update Plugins
  jenkins_plugin:
    name: "{{ item }}"
    state: latest
    jenkins_home: "{{ jenkins_home }}"
    url: "{{ jenkins_url_local }}"
    params:
      url_username: "{{ jenkins_dynamic_admin_username | default(omit) }}"
    url_password: "{{ jenkins_dynamic_admin_password | default(omit) }}"
    validate_certs: "{{ false if ansible_distribution_release == 'trusty' else true }}"
    timeout: 120
  with_items:
    - "{{ jenkins_plugins_recommended }}"
    - "{{ jenkins_plugins_extra }}"
  become: true
  notify:
    - "Restart Service 'jenkins'"

Ansible 2.5 isn't supported.

The roles jenkins_plugin implementation doesn't work correctly while using Ansible 2.5

failed: [10.0.0.201] (item=cloudbees-folder) => {"changed": false, "item": "cloudbees-folder", "msg": "The params option to jenkins_plugin was removed in Ansible 2.5 since it circumvents Ansible's option handling"}

Fixed the problem locally by modifying the Install Plugins and Update Plugins tasks. Removed the params implementation like so:

- name: Install Plugins
  jenkins_plugin:
    name: "{{ item }}"
    state: present
    jenkins_home: "{{ jenkins_home }}"
    url: "{{ jenkins_url_local }}"
    url_username: "{{ jenkins_dynamic_admin_username | default(omit) }}"
    url_password: "{{ jenkins_dynamic_admin_password | default(omit) }}"
    validate_certs: "{{ false if ansible_distribution_release == 'trusty' else true }}"
    timeout: "{{ jenkins_plugins_timeout }}"
  with_items:
    - "{{ jenkins_plugins_recommended }}"
    - "{{ jenkins_plugins_extra }}"
  become: true
  notify:
    - "Restart Service 'jenkins'"

Haven't made a merge request, since now I'm pretty sure this change will break Ansible 2.4 usage.

Thoughts, suggestions? Perhaps you @karlmdavis are willing to drop 2.4 support?

Example playbook fails in Vagrant

The Example Playbook in the README doesn't work out of the box.

Using for instance:

- hosts: all
  vars:
    jenkins_port: 8080

  roles:
     - karlmdavis.jenkins2

In Vagrant, gives:

TASK [karlmdavis.jenkins2 : Update APT Cache] **********************************
fatal: [jenkins]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to lock apt for exclusive operation"}
        to retry, use: --limit @/Users/caleb/dev/ansible-galaxies/jenkins.retry

This is simple enough to fix by adding become: yes here or there.

Support operating in restricted Internet environments

If operating in an environment with a restrictive proxy server, we need the ability to specify exactly which of the YUM/APT mirrors will be used when installing Jenkins.

Also need to specify no_proxy on anything grabbing HTTP content from localhost.

Tons of deprecation warnings when running in Ansible 2.4

Ansible's task/role/variable inclusion facilities were rather drastically overhauled in v2.4. The changes are definitely all for the better, but lead to a bunch of deprecation warnings for any project that was previously using role or task includes, like this one.

Unfortunately, I don't see a backwards-compatible way for us to resolve those warnings in 2.4 while still supporting 2.0. We'll have to pick a point in time to drop support for 2.0... maybe six months from now? That'd be March or April of next year.

Add config option for session timeout

Would be nice if it was easy to configure Jenkins' session timeout.

(Not strictly needed as a feature, since the Java args can be customized, but it's a convenient one to have called out.)

Verify CLI step fails without manual intervention

I found I had to manually disable security to get the cli to work, and a small amount of research couldn't turn up why the cli would work over http without securtiy being disabled - neither the -i or -auth options seem to be passed to the calls to jenkins-cli.

It gave an error of 'ERROR: anonymous is missing the Overall/Read permission'

So I manually switched security off, ran the role again, and it worked.

PS Thanks for the role!

Test failures with Ubuntu 14.04

The geerlingguy.java role does not work with Ubuntu 14.04 and oracle-java8 anymore. Maybe it is a good time to just ignore Ubuntu 14.04 and run tests with Ubuntu 18.04. Also, Ubuntu 14.04 has End of Standard Support (see: https://wiki.ubuntu.com/Releases).

fatal: [docker_container]: FAILED! => {"changed": false, "msg": "No package matching 'oracle-java8-installer' is available"}

Failure occurs in PR #62

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.