syntax = "proto2";

import "goby/zeromq/protobuf/liaison_config.proto";

package jaiabot.protobuf;

message UpgradeConfig
{
    enum Role
    {
        USER = 1;
        ADVANCED = 2;
        DEVELOPER = 3;
    }

    optional Role role = 1 [default = USER];

    message AnsiblePlaybook
    {
        required string file = 1;
        required string name = 2;
        required Role role = 3;
        
        message Variable
        {
            required string name = 1;
            required string display_name = 2;
            repeated string value = 3;
            optional string static_value = 4;
        }
        repeated Variable input_var = 4;
        repeated Variable output_var = 5;
        optional bool confirmation_required = 6 [default = false];
        optional string limit = 7;
        optional string inventory = 8; // overrides ansible_inventory at parent scope
        optional string section = 9 [default = "General"];
        optional bool causes_hub_reboot = 10 [default = false];
    }
    repeated AnsiblePlaybook ansible_playbook = 2;
    required string ansible_inventory = 3;
    required string ansible_config = 4;
    
    // limit hosts to this hub and the bots, since currently we do not have
    // hub<->hub networking
    required string this_hub = 5;

    optional string ansible_playbook_full_path = 6; // if set, this is the full path to the ansible-playbook binary to use, rather than search the $PATH

    optional string ansible_log_dir = 7 [default = "/tmp/jaiabot-ansible"];
    
    optional double check_freq = 10 [default = 10];

}

extend goby.apps.zeromq.protobuf.LiaisonConfig
{
    optional UpgradeConfig jaiabot_upgrade_config = 1301;
}
