Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: Install Hybris on VM
- hosts: localhost
- become: true
- vars:
- hybris_home: "/bin/hybris"
- app_home: "/var/app"
- hybris_platform_file: "hybrisServer-Platform.zip"
- hybris_extensions_file: "hybrisServer-AllExtensions.zip"
- logs: []
- vars_prompt:
- - name: "hybris_url"
- prompt: "Enter Hybris setup url"
- - name: "username"
- prompt: "Enter your username"
- - name: "password"
- prompt: "Enter your password"
- tasks:
- - name: Run the equivalent of "apt-get update"
- apt:
- update_cache: yes
- - name: Install Java 1.8 so we can use it
- apt:
- name: default-jdk
- update_cache: yes
- state: latest
- - name: Install ant
- apt:
- name: ant
- update_cache: yes
- state: latest
- - name: Install unzip
- apt:
- name: unzip
- update_cache: yes
- state: latest
- - name: Create the hybris user
- user:
- name: hybris
- comment: "Hybris user"
- state: present
- groups: "sudo,admin"
- - name: Create Hybris home directory
- file:
- path: "{{ hybris_home }}"
- state: directory
- mode: 0755
- owner: hybris
- group: hybris
- - name: Create app directory
- file:
- path: "{{app_home}}"
- state: directory
- mode: 0755
- owner: hybris
- group: hybris
- # - name: Get Hybris setup from url
- # uri:
- # client_cert: "hybris/wikigoodyeareu.pem"
- # url: "{{ hybris_url }}/{{hybris_platform_file}}"
- # method: GET
- # user: "{{ username}} "
- # password: "{{password}}"
- # dest: "/tmp"
- # force_basic_auth: yes
- # validate_certs: no
- - name: Unarchive Hybris binaries
- unarchive:
- src: "hybris/{{ hybris_platform_file }}"
- dest: "{{ app_home }}"
- become_user: hybris
- - name: Unarchive Hybris extensions
- unarchive:
- src: "hybris/{{ hybris_extensions_file }}"
- dest: "{{ app_home }}"
- become_user: hybris
- - name: Remove Hybris setup archive
- file:
- state: absent
- path: "/hybris/{{ hybris_platform_file }}"
- - name: Remove Hybris extensions archive
- file:
- state: absent
- path: "/hybris/{{ hybris_extensions_file }}"
- - name: Set ANT env
- command: sh "{{ app_home }}/hybris/bin/platform/setantenv.sh"
- become_user: hybris
- # - name: Perform ANT Clean all
- # command: chdir="{{app_home}}/hybris/bin/platform" ant clean all -Dinput.template=develop
- # become_user: hybris
- - name: Run "ant" in the platform dir
- command: chdir="{{app_home}}/hybris/bin/platform" ant
- become_user: hybris
- - name: Start Hybris server
- command: sh "{{app_home}}/hybris/bin/platform/hybrisserver.sh"
- become_user: hybris
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement