picodata / genin

Ansible cartridge inventory generator
BSD 2-Clause "Simplified" License
10 stars 3 forks source link

Add error parsing in vars and failover #120

Closed avprotsenko closed 1 year ago

avprotsenko commented 1 year ago

Now when error occurs in vars or failover section of cluster.genin.yaml the error is Data did not match any variant of cluster configuration(Ok(failover: InvalidFailover)). How to reproduce:

---
topology:
  - name: router
    replicasets_count: 1 # How many masters we want, by default equal 1
    roles:
      - router
      - failover-coordinator
    config:
      memtx_memory: 134217728
  - name: storage
    replicasets_count: 2 # How many masters we want, by default equal 1
    replication_factor: 2 # Number of replicas in replicaset, default 0
    config:
      vshard_group: storage
    roles:
      - storage
    config:
      memtx_memory: 134217728
hosts:
  - name: datacenter-1
    config:
      http_port: 8081 # Specify http port to start counting from
      binary_port: 3031 # Specify binary port to start counting from
    hosts:
      - name: server-1
        config:
          http_port: 8081 # Specify http port to start counting from
          binary_port: 3031 # Specify binary port to start counting from
          address: 192.168.16.11 # Host or instance address (maybe IP or URI)
      - name: server-2
        config:
          http_port: 8081 # Specify http port to start counting from
          binary_port: 3031 # Specify binary port to start counting from
          address: 192.168.16.12
failover: # Host or instance address (maybe IP or URI)
  mode: stateful # Failover mode (stateful, eventual, disabled)
  state_provider: stateboard # What is serve failover (stateboard, stateful)
  stateboard_params:
    uri: "192.168.16.11:4401" # Uri on which the stateboard will be available
    password: password
vars: # Stateboard password
  ansible_user: ansible # Username under which the ansible will connect to the servers
  ansible_password: ansible # Stateboard password
  cartridge_app_name: myapp
  cartridge_cluster_cookie: myapp-cookie # Cookie for connecting to the administrative console of the instances
  cartridge_package_path: /tmp/myapp.rpm # Path to the application package
  cartridge_bootstrap_vshard: true

genin build