Skip to content
Snippets Groups Projects
bootstrap.yml 1.77 KiB
Newer Older
Varac's avatar
Varac committed
- hosts: all
  gather_facts: False
Varac's avatar
Varac committed
  pre_tasks:
    - name: Require minimal ansible version
      assert:
        that:
Varac's avatar
Varac committed
          - "ansible_version.full is version_compare('2.7', '>=')"
Varac's avatar
Varac committed
        msg: >
Varac's avatar
Varac committed
          "Please use Ansible 2.7 or higher to bootstrap your OAS cluster."
    - name: Release name must start with lower case
Ana Aviles's avatar
Ana Aviles committed
      assert:
Ana Aviles's avatar
Ana Aviles committed
        that: "'{{ release_name }}' is match('^[a-z]')"
Ana Aviles's avatar
Ana Aviles committed
        msg: >
Ana Aviles's avatar
Ana Aviles committed
          "Release name ({{ release_name }}) should start with lower case."
Ana Aviles's avatar
Ana Aviles committed

    - name: cluster_dir variable is needed
      assert:
        that: "cluster_dir is defined"
        msg: >
          "Please define the variable `cluster_dir`."

- name: Configure all hosts
  # We use `mitogen_linear` as default strategy. However,
  # mitogen fails installing the `openshift` python module as requirement
  # for the `k8s` ansible resource, and using `k8s` in the same context.
  # That's why we use the standard `linear` ansible strategy for this role.
  # See https://open.greenhost.net/openappstack/openappstack/issues/102
  strategy: linear
    - role: configure
      tags: ['configure']

- name: Prepare nodes
    - role: prepare_node
      tags: ['prepare_node']

- name: Install control shell
  hosts: master
  tasks:
  - name: Run everything
    block:
          name: get_control
        tags: ['get_control']
          name: rke_configuration
        tags: ['rke_configuration']
          name: setup
        tags: ['setup']
          name: apps
        tags: ['apps']
      - import_role:
          name: local-flux
        tags: ['flux']
          name: finalize
        tags: ['finalize']