ansible-jenkins icon indicating copy to clipboard operation
ansible-jenkins copied to clipboard

Configure custom files looping over folder(recurcive)

Open pkozlovskiy opened this issue 7 years ago • 2 comments

Hi! Nice job, I like this role! I have a dir like this config/ .ssh/ id_rsa prodSlaveFiles/ .. init.groovy.d/ .. credentials.xml hudson.plugins.git.GitSCM.xml ...

How to set jenkins_custom_files to copy content of folder to jenkins_home?

pkozlovskiy avatar Jun 23 '17 08:06 pkozlovskiy

Hi @pkozlovskiy, glad you find the role useful.

There is an example in the README, does that help? https://github.com/emmetog/ansible-jenkins#example-playbook

- hosts: jenkins

  vars:
    jenkins_version: "1.642.4"
    jenkins_url: http://jenkins.example.com
    jenkins_port: 80
    jenkins_install_via: "docker"
    jenkins_jobs:
        - "my-first-job"
        - "another-awesome-job"
    jenkins_include_secrets: true
    jenkins_include_custom_files: true
    jenkins_custom_files:
      - src: "jenkins.plugins.openstack.compute.UserDataConfig.xml"
        dest: "jenkins.plugins.openstack.compute.UserDataConfig.xml"
    jenkins_custom_plugins:
        - "openstack-cloud-plugin/openstack-cloud.jpi"
      
  roles:
    - emmetog.jenkins

emmetog avatar Jun 23 '17 08:06 emmetog

@emmetog In example only one file, but if I have 20 it`s not pretty to put them all(40 lines) in playbook... and all files no needed for template, just copy...

pkozlovskiy avatar Jun 23 '17 13:06 pkozlovskiy