--- - name: Install requiered apt: name: openjdk-11-jre state: latest tags: jenkins - name: Install nginx apt: name: nginx state: latest tags: jenkins - name: Deploy nginx conf template: src=nginx.conf.j2 dest=/etc/nginx/ansible_conf.d/jenkins.conf notify: reload nginx tags: jenkins - name: Download jenkins get_url: url: "{{ jenkins_war_url }}" dest: "{{ jenkins_root_dir }}" checksum: "sha256:{{ jenkins_war_sha256 }}" validate_certs: no tags: jenkins - name: Deploy systemd unit template: src=jenkins.service.j2 dest=/etc/systemd/system/jenkins.service notify: Reload systemd tags: jenkins - name: Flush handlers meta: flush_handlers tags: jenkins - name: Enable & start service jenkins systemd: name: jenkins enabled: yes masked: no state: started notify: start jenkins