ansible script to install jenkins

jenkins ansible 5 years, 12 months ago
--- - name: Ensure APT official jenkins key apt_key: url: "{{ jenkins_repo_key_url }}" - name: Check APT official jenkins repository apt_repository: repo: "{{ jenkins_repo_url }}" - name: Install packages apt: name: "{{ item }}" state: present update_cache: "yes" with_items: "{{ jenkins_pkg }}" - name: upgarde boto pip: name: "boto" extra_args: "--upgrade" - name: install ansible 2.3 pip: name: "{{ ansible_repo }}" editable: false - name: Create Updates folder file: path: "{{ jenkins_updates_dir }}" owner: "{{ jenkins_user }}" group: "{{ jenkins_group }}" mode: 0755 state: directory - name: check default.json stat: path: "{{ jenkins_updates_dir }}/default.json" register: def_j - name: Permissions for default.json updates info. file: path: "{{ jenkins_updates_dir }}/default.json" owner: "{{ jenkins_user }}" group: "{{ jenkins_group }}" mode: 0755 state: touch when: "{{ not def_j.stat.exists }}" - name: Jenkins key dir file: state: "directory" owner: "jenkins" group: "jenkins" mode: "0755" path: "{{ jenkins_home }}/.ssh" - name: add ansible key copy: src: "{{ playbook_dir }}/keys/{{ ssh_key_name }}" dest: "{{ jenkins_home }}/.ssh" owner: "jenkins" group: "jenkins" mode: "0600" - name: add github key copy: src: "{{ playbook_dir }}/keys/{{ git_key_name}}" dest: "/home/ubuntu/.ssh" owner: "ubuntu" group: "ubuntu" mode: "0600"
1069
Posted By