{
  "type": "object",
  "properties": {
    "help": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "targets": {
      "type": "object",
      "patternProperties": {
        "type": "object",
        "^[a-z0-9]*$": {
          "required": [
            "managers"
          ],
          "properties": {
            "homedir": {
              "type": "string"
            },
            "managers": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "pem",
                  "user",
                  "machine",
                  "active"
                ],
                "properties": {
                  "pem": {
                    "type": "string"
                  },
                  "user": {
                    "type": "string"
                  },
                  "machine": {
                    "type": "string"
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            },
            "username": {
              "type": "string"
            },
            "elb": {
              "type": "object",
              "required": [
                "type",
                "dns"
              ],
              "properties": {
                "type": {
                  "type": "integer",
                  "enum": [
                    0,
                    1
                  ]
                },
                "dns": {
                  "type": "string"
                }
              }
            },
            "workers": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "pem": {
                    "type": "string"
                  },
                  "user": {
                    "type": "string"
                  },
                  "machine": {
                    "type": "string"
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "additionalProperties": false
    },
    "npminstall": {
      "type": "boolean"
    },
    "deploymentmode": {
      "type": "string",
      "enum": [
        "prod",
        "qa",
        "dev"
      ]
    },
    "npmdir": {
      "type": "string"
    },
    "pccopy": {
      "type": "boolean"
    },
    "appdir": {
      "type": "string"
    },
    "destdir": {
      "type": "string"
    },
    "tmpdir": {
      "type": "string"
    },
    "appserviceconfig": {
      "type": "string"
    },
    "corsdomains": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "appcopy": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "srcdir": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "destdir": {
            "type": "string"
          },
          "recursive": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          }
        }
      }
    },
    "systemservices": {
      "type": "object",
      "patternProperties": {
        "type": "object",
        "^[a-zA-Z0-9_\\-]*$": {
          "properties": {
            "secret": {
              "type": "string"
            },
            "overrides": {
              "type": "object",
              "properties": {
                "certpath": {
                  "type": "string"
                }
              }
            },
            "persistence": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "bucketname": {
                  "type": "string"
                },
                "acckey": {
                  "type": "string"
                },
                "secret": {
                  "type": "string"
                },
                "region": {
                  "type": "string"
                }
              }
            },
            "replicas": {
              "type": "integer"
            },
            "initoptions": {
              "type": "object"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "appservices": {
      "type": "object",
      "patternProperties": {
        "type": "object",
        "^[a-zA-Z0-9_\\-]*$": {
          "properties": {
            "replicas": {
              "type": "integer"
            },
            "workingdir": {
              "type": "string"
            },
            "exec": {
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "enterpriseservices": {
      "type": "object",
      "patternProperties": {
        "type": "object",
        "^[a-zA-Z0-9_\\-]*$": {
          "properties": {
            "replicas": {
              "type": "integer"
            },
            "workingdir": {
              "type": "string"
            },
            "exec": {
              "type": "string"
            },
            "ports": {
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "object",
                    "required": [
                      "containerport",
                      "hostport"
                    ],
                    "properties": {
                      "containerport": {
                        "type": "integer"
                      },
                      "hostport": {
                        "type": "integer"
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      }
    },
    "elk": {
      "type": "object",
      "properties": {
        "cluster_docker": {
          "type": "string"
        },
        "vpn_not": {
          "type": "string"
        },
        "targetmachine_docker": {
          "type": "string"
        },
        "targetmachine": {
          "type": "string"
        },
        "kibanamachine": {
          "type": "string"
        },
        "nodes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "pem": {
                "type": "string"
              },
              "user": {
                "type": "string"
              },
              "machine": {
                "type": "string"
              },
              "internalip": {
                "type": "string",
                "format": "ip-address"
              },
              "master": {
                "type": "boolean"
              },
              "node": {
                "type": "boolean"
              },
              "active": {
                "type": "boolean"
              },
              "kibana": {
                "type": "boolean"
              }
            }
          }
        }
      }
    }
  }
}