|
67 | 67 | retries: 60
|
68 | 68 | become: false
|
69 | 69 |
|
70 |
| - - name: Install and Activate AEM Service Pack 1 package (automatically restarts the server) |
71 |
| - command: curl -u admin:admin -F file=@"/home/vagrant/aem_install_files/packages_to_install/servicepacks/aem-service-pkg-wrapper-6.1.SP1.zip" -F force=true -F install=true localhost:4502/crx/packmgr/service.jsp |
72 |
| - become: false |
| 70 | + - name: Check if AEM Service Pack 1 has been installed |
| 71 | + command: curl --fail -u admin:admin http://localhost:4502/crx/packmgr/service.jsp?cmd=ls |
| 72 | + register: installedBundlesPreSP1Check |
| 73 | + |
| 74 | + - name: Install and Activate AEM Service Pack 1 package (automatically restarts the server) if not installed |
| 75 | + command: curl --fail -u admin:admin -F file=@"/home/vagrant/aem_install_files/packages_to_install/servicepacks/aem-service-pkg-wrapper-6.1.SP1.zip" -F force=true -F install=true localhost:4502/crx/packmgr/service.jsp |
| 76 | + when: installedBundlesPreSP1Check.stdout.find("aem-service-pkg-wrapper-6.1.SP1.zip") == -1 |
73 | 77 |
|
74 | 78 | - name: Wait for the server to come up
|
75 | 79 | shell: 'curl 127.0.0.1:4502 -L -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:46.0) Gecko/20100101 Firefox/46.0"'
|
76 | 80 | register: afterServicePackInstall
|
77 | 81 | until: afterServicePackInstall.stdout.find("Sign In") != -1
|
78 | 82 | retries: 60
|
79 | 83 | become: false
|
| 84 | + |
| 85 | + - name: Check if ACS-Commons Library has been installed |
| 86 | + command: curl --fail -u admin:admin http://localhost:4502/crx/packmgr/service.jsp?cmd=ls |
| 87 | + register: installedBundlesPreACSCommonsCheck |
80 | 88 |
|
81 |
| - - name: Install ACS-Commons Library (automatically restarts the server) |
82 |
| - shell: curl --fail -u admin:admin -F file=@"/home/vagrant/aem_install_files/packages_to_install/servicepacks/acs-aem-commons-content-2.4.2-min.zip" -F force=true -F install=true localhost:4502/crx/packmgr/service.jsp |
| 89 | + - name: Install ACS-Commons Library (automatically restarts the server) if not installed |
| 90 | + command: curl --fail -u admin:admin -F file=@"/home/vagrant/aem_install_files/packages_to_install/servicepacks/acs-aem-commons-content-2.4.2-min.zip" -F force=true -F install=true localhost:4502/crx/packmgr/service.jsp |
| 91 | + when: installedBundlesPreACSCommonsCheck.stdout.find("acs-aem-commons-content-2.4.2.zip") == -1 |
83 | 92 |
|
84 | 93 | - name: Wait for the server to come up
|
85 | 94 | shell: 'curl 127.0.0.1:4502 -L -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:46.0) Gecko/20100101 Firefox/46.0"'
|
86 | 95 | register: afterACSCommonsInstall
|
87 | 96 | until: afterACSCommonsInstall.stdout.find("Sign In") != -1
|
88 | 97 | retries: 60
|
89 | 98 | become: false
|
| 99 | + |
| 100 | + - name: Check if UI-apps has been installed |
| 101 | + command: curl --fail -u admin:admin http://localhost:4502/crx/packmgr/service.jsp?cmd=ls |
| 102 | + register: installedBundlesPreUIAppsCheck |
| 103 | + |
| 104 | + - name: Install ui-apps (components) if not installed |
| 105 | + shell: curl --fail -u admin:admin -F file=@"/home/vagrant/aem_install_files/packages_to_install/servicepacks/gc-aem.ui.apps-1.12.1.zip" -F force=true -F install=true localhost:4502/crx/packmgr/service.jsp |
| 106 | + when: installedBundlesPreUIAppsCheck.stdout.find("gc-aem.ui.apps-1.12.1.zip") == -1 |
90 | 107 |
|
91 | 108 | - name: Get list of content packs to install
|
92 | 109 | shell: ls /home/vagrant/aem_install_files/packages_to_install/content/*
|
93 | 110 | register: packages_list
|
94 | 111 |
|
95 | 112 | - name: Install all content packs
|
96 |
| - shell: 'curl --fail -u admin:admin -F file=@"{{item}}" -F force=true -F install=true localhost:4502/crx/packmgr/service.jsp && sleep 2' |
| 113 | + shell: 'if [[ $(curl --fail -u admin:admin http://localhost:4502/crx/packmgr/service.jsp?cmd=ls) != *$(basename "{{item}}")* ]]; then curl --fail -u admin:admin -F file=@"{{item}}" -F force=true -F install=true localhost:4502/crx/packmgr/service.jsp && sleep 2; fi' |
97 | 114 | with_items: packages_list.stdout_lines
|
98 | 115 | become: false
|
99 | 116 |
|
|
0 commit comments