Skip initial setup wizard in Jenkins (latest version) using ansible in ubuntu

Viewed 45

I am trying to setup Jenkins using ansible in ubuntu for which I want to skip the initial setup wizard in Jenkins. While I am using this code in local host it worked fine but in EC2 instance it's not working .The initial setup wizard appears.

 - name: Disable Jenkins setup wizard
      lineinfile:
       dest=/etc/default/jenkins
       regexp=^JAVA_ARGS=
       line=JAVA_ARGS="-Djava.awt.headless=true -Djenkins.install.runSetupWizard=false"
      become: true

    - name: Start jenkins
      service:
        name: jenkins
        enabled: true
        state: started

    - name: Wait for Jenkins to start up
      uri:
        url: http://{{ HostName }}:8080
        status_code: 200
        timeout: 5
      register: jenkins_service_status
      # Keep trying for 5 mins in 5 sec intervals
      retries: 60
      delay: 5
      until: >
        'status' in jenkins_service_status and
        jenkins_service_status['status'] == 200 

Please can you suggest me how to remove the initial set wizard or else how to configure it using ansible.

0 Answers
Related