fbo / rpms / nodepool

Forked from rpms/nodepool 4 years ago
Clone
57204ac
- hosts: localhost
57204ac
  tasks:
57204ac
    - name: Install JDK
57204ac
      package:
57204ac
        name: java-latest-openjdk
57204ac
        state: present
57204ac
      become: true
57204ac
57204ac
    - name: Create /tmp/zookeeper
57204ac
      file:
57204ac
        path: /tmp/zookeeper
57204ac
        state: directory
57204ac
57204ac
    - name: Get and extract Zookeeper
57204ac
      unarchive:
57204ac
        src: https://www-us.apache.org/dist/zookeeper/stable/apache-zookeeper-3.5.6-bin.tar.gz
57204ac
        dest: /tmp/zookeeper
57204ac
        remote_src: yes
57204ac
57204ac
    - name: Setup Zookeeper config file
57204ac
      copy:
57204ac
        src: /tmp/zookeeper/apache-zookeeper-3.5.6-bin/conf/zoo_sample.cfg
57204ac
        dest: /tmp/zookeeper/apache-zookeeper-3.5.6-bin/conf/zoo.cfg
57204ac
        remote_src: true
57204ac
57204ac
    - name: Start Zookeeper
57204ac
      shell: /tmp/zookeeper/apache-zookeeper-3.5.6-bin/bin/zkServer.sh start
57204ac
57204ac
    - name: Install Nodepool packages
57204ac
      package:
57204ac
        name:
57204ac
          - nodepool-builder
57204ac
          - nodepool-launcher
57204ac
          - nodepool-doc
57204ac
        state: present
57204ac
      become: true
57204ac
57204ac
    - name: Start Nodepool services
57204ac
      service:
57204ac
        name: "{{ item }}"
57204ac
        state: started
57204ac
      loop:
57204ac
        - nodepool-builder
57204ac
        - nodepool-launcher
57204ac
      become: true
57204ac
57204ac
    - name: Pause 10 seconds to give time for services to start
57204ac
      pause:
57204ac
        seconds: 10
57204ac
57204ac
    - name: Check Nodepool services 
57204ac
      shell: systemctl is-active {{ item }}
57204ac
      loop:
57204ac
        - nodepool-builder
57204ac
        - nodepool-launcher
57204ac
57204ac
    - name: Run a nodepool list
57204ac
      shell: nodepool list