fbo / rpms / nodepool

Forked from rpms/nodepool 2 years ago
Clone
Blob Blame History Raw
- hosts: localhost
  tasks:
    - name: Install JDK
      package:
        name: java-latest-openjdk
        state: present
      become: true

    - name: Create /tmp/zookeeper
      file:
        path: /tmp/zookeeper
        state: directory

    - name: Get and extract Zookeeper
      unarchive:
        src: https://www-us.apache.org/dist/zookeeper/stable/apache-zookeeper-3.5.6-bin.tar.gz
        dest: /tmp/zookeeper
        remote_src: yes

    - name: Setup Zookeeper config file
      copy:
        src: /tmp/zookeeper/apache-zookeeper-3.5.6-bin/conf/zoo_sample.cfg
        dest: /tmp/zookeeper/apache-zookeeper-3.5.6-bin/conf/zoo.cfg
        remote_src: true

    - name: Start Zookeeper
      shell: /tmp/zookeeper/apache-zookeeper-3.5.6-bin/bin/zkServer.sh start

    - name: Install Nodepool packages
      package:
        name:
          - nodepool-builder
          - nodepool-launcher
          - nodepool-doc
        state: present
      become: true

    - name: Start Nodepool services
      service:
        name: "{{ item }}"
        state: started
      loop:
        - nodepool-builder
        - nodepool-launcher
      become: true

    - name: Pause 10 seconds to give time for services to start
      pause:
        seconds: 10

    - name: Check Nodepool services 
      shell: systemctl is-active {{ item }}
      loop:
        - nodepool-builder
        - nodepool-launcher

    - name: Run a nodepool list
      shell: nodepool list