[AETHER-852] - Mask the service to enusre Jenkins will load the latest config.

- Only generate the init groovy script for first-time installation
- Remove init groovy script after first-time instllation.
- Moved the variable location

Change-Id: I0c0fb01f21353c817e2de986c86903df0387b9e4
diff --git a/tasks/settings.yml b/tasks/settings.yml
index 707e128..a776bae 100644
--- a/tasks/settings.yml
+++ b/tasks/settings.yml
@@ -29,3 +29,16 @@
     owner: "{{ jenkins_process_user }}"
     group: "{{ jenkins_process_group }}"
     mode: 0775
+
+- name: generate groovy for initializing local admin account
+  template:
+    src: init_admin.groovy.j2
+    dest: "{{ jenkins_home }}/init.groovy.d/basic-security.groovy"
+    owner: "{{ jenkins_process_user }}"
+    group: "{{ jenkins_process_group }}"
+    mode: 0775
+  when: "'jenkins' not in ansible_facts.packages"
+  notify:
+    - unmask-jenkins
+    - enable-jenkins
+    - start-jenkins