Installation on Linux with Ansible

From Lazarus wiki
Revision as of 07:47, 25 June 2018 by Serbod (talk | contribs) (Serbod moved page headless to Installation on Linux with Ansible)

fpclazup Installation on Linux with Ansible

File lazarus_vars.yml containing the user under which Lazarus should be installed:

lazarus_user: "lazar"

The actual playbook:

- hosts:
          - lazarus_vars.yml


# prerequisites
  - name: update packages
    become: yes
    apt: "update_cache=yes"

  - name: install dependencies
    become: yes
    apt: name={{item}} state=latest
          - "make"
          - "binutils"
          - "build-essential"
          - "gdb"
          - "subversion"
          - "zip"
          - "unzip"
          - "libx11-dev"
          - "libgtk2.0-dev"
          - "libgdk-pixbuf2.0-dev"
          - "libcairo2-dev"
          - "libpango1.0-dev"
          - "unrar"
          - "libxtst-dev"
          - "libgl1-mesa-dev"
          - "libatk-adaptor"

  - name: create user for Lazarus installation
    become: yes
    user: name="{{lazarus_user}}"

  - name: get url for latest fpclazup
       module: uri
       return_content: yes
       method: GET
    register: json_info

  - name: download latest fpclazup
    become: yes
    become-user: "{{lazarus_user}}"
      url: "{{json_info.json.assets[10].browser_download_url}}"
      dest: "/home/{{lazarus_user}}/"

  - name: make downloaded executable
    become: yes
    become-user: "{{lazarus_user}}"
    shell: chmod +x /home/{{lazarus_user}}/fpclazup-x86_64-linux

  - name: install 64bit
    become: yes
    become-user: "{{lazarus_user}}"
    shell: /home/{{lazarus_user}}/fpclazup-x86_64-linux --fpcURL="stable" --lazURL="stable" --installdir=usr/share/fpclazstable --fpcsplit --noconfirm