aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles/infra_create_vms
AgeCommit message (Collapse)AuthorFilesLines
2018-05-29Improve VMs spawning for OpenStackStepan Andrushko2-0/+65
In some, like 5% or so, VMs become not responsible. Added a validation to make sure VMs are reachable over SSH. In case of issue - restarting VM. JIRA: YARDSTICK-1141 Change-Id: I110fe35b4b7bdbc4ba962d3814ce0f8cd40e5400 Signed-off-by: Stepan Andrushko <stepanx.andrushko@intel.com>
2018-04-26OpenStack deployment using kollaStepan Andrushko1-2/+0
OpenStack deployment using Kolla installer for all-in-one mode and multinode inside VMs which are already created. Two types of OpenStack nodes are supported as input in sample files, like infra_deploy_two.yaml.sample: controller and compute. JIRA: YARDSTICK-1078 Change-Id: I51616a7a17ac565a01ec6da57b589290237d18ee Signed-off-by: Stepan Andrushko <stepanx.andrushko@intel.com>
2018-03-12Add support for VNC to VMs created by ansibleJohn O Loughlin1-0/+14
JIRA: YARDSTICK-1017 Change-Id: I76ca53c12a6791ecbf7f546f9074b16c5f6d215a Signed-off-by: John O Loughlin <john.oloughlin@intel.com>
2018-03-08Merge "Allow VMs to access internet"Rodolfo Alonso Hernandez3-3/+19
2018-03-06Allow VMs to access internetJohn O Loughlin3-3/+19
Add option to the config file for default network. Check to see if 1 default network is defined. Enable nat on all defined networks. Add default gateway to VM JIRA: YARDSTICK-1016 Change-Id: Ie943a7c7b4f1a9673774cf8fedaba0af352cd7f4 Signed-off-by: John O Loughlin <john.oloughlin@intel.com>
2018-03-05Bug fix ansible scriptsJohn O Loughlin1-1/+1
For 'qemu-img version 2.10.1' unit 'MB' is not acceptable Changing to 'M' JIRA: YARDSTICK-1019 Change-Id: Ic9153e9e9c85d949d15b1d15cc8cddfad986b4a3 Signed-off-by: John O Loughlin <john.oloughlin@intel.com>
2018-02-12Create host VMs configurationJohn O Loughlin3-0/+435
Using xml files deploy the VM's using the virt plugin. This code generates the user-data network-config meta-data and the vm's xml. It also deploys the vm JIRA: YARDSTICK-963 Change-Id: I97f2d20d0ab75a4444b8b8e6fb65e9e463870af7 Signed-off-by: John O Loughlin <john.oloughlin@intel.com>
.na { color: #a6e22e } /* Name.Attribute */ .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ .highlight .nc { color: #a6e22e } /* Name.Class */ .highlight .no { color: #66d9ef } /* Name.Constant */ .highlight .nd { color: #a6e22e } /* Name.Decorator */ .highlight .ni { color: #f8f8f2 } /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
heat_template_version: pike

description: >
  OpenStack Barbican API service configured with Puppet

parameters:
  ServiceData:
    default: {}
    description: Dictionary packing service data
    type: json
  ServiceNetMap:
    default: {}
    description: Mapping of service_name -> network name. Typically set
                 via parameter_defaults in the resource registry.  This
                 mapping overrides those in ServiceNetMapDefaults.
    type: json
  DefaultPasswords:
    default: {}
    type: json
  RoleName:
    default: ''
    description: Role name on which the service is applied
    type: string
  RoleParameters:
    default: {}
    description: Parameters specific to the role
    type: json
  EndpointMap:
    default: {}
    description: Mapping of service endpoint -> protocol. Typically set
                 via parameter_defaults in the resource registry.
    type: json
  BarbicanPassword:
    description: The password for the barbican service account.
    type: string
    hidden: true
  BarbicanWorkers:
    description: Set the number of workers for barbican::wsgi::apache
    default: '%{::processorcount}'
    type: string
  Debug:
    default: ''
    description: Set to True to enable debugging on all services.
    type: string
  BarbicanDebug:
    default: ''
    description: Set to True to enable debugging Barbican service.
    type: string
  KeystoneRegion:
    type: string
    default: 'regionOne'
    description: Keystone region for endpoint
  RabbitClientPort:
    default: 5672
    description: Set rabbit subscriber port, change this if using SSL
    type: number
  RabbitClientUseSSL:
    default: false
    description: >
        Rabbit client subscriber parameter to specify
        an SSL connection to the RabbitMQ host.
    type: string
  RabbitPassword:
    description: The password for RabbitMQ
    type: string
    hidden: true
  RabbitUserName:
    default: guest
    description: The username for RabbitMQ
    type: string
  EnableInternalTLS:
    type: boolean
    default: false
  BarbicanPolicies:
    description: |
      A hash of policies to configure for Barbican.
      e.g. { barbican-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
    default: {}
    type: json
  NotificationDriver:
    type: string
    default: 'messagingv2'
    description: Driver or drivers to handle sending notifications.
    constraints:
      - allowed_values: [ 'messagingv2', 'noop' ]

resources:

  ApacheServiceBase:
    type: ./apache.yaml
    properties:
      ServiceData: {get_param: ServiceData}
      ServiceNetMap: {get_param: ServiceNetMap}
      DefaultPasswords: {get_param: DefaultPasswords}
      EndpointMap: {get_param: EndpointMap}
      RoleName: {get_param: RoleName}
      RoleParameters: {get_param: RoleParameters}

conditions:
  service_debug_unset: {equals : [{get_param: BarbicanDebug}, '']}

outputs:
  role_data:
    description: Role data for the Barbican API role.
    value:
      service_name: barbican_api
      config_settings:
        map_merge:
          - get_attr: [ApacheServiceBase, role_data, config_settings]
          - barbican::keystone::authtoken::password: {get_param: BarbicanPassword}
            barbican::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
            barbican::keystone::authtoken::auth_url: { get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
            barbican::keystone::authtoken::project_name: 'service'
            barbican::policy::policies: {get_param: BarbicanPolicies}
            barbican::api::host_href: {get_param: [EndpointMap, BarbicanPublic, uri]}
            barbican::api::db_auto_create: false
            barbican::api::enabled_certificate_plugins: ['simple_certificate']
            barbican::api::logging::debug:
              if:
              - service_debug_unset
              - {get_param: Debug }
              - {get_param: BarbicanDebug }
            barbican::api::notification_driver: {get_param: NotificationDriver}
            barbican::api::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
            barbican::api::rabbit_userid: {get_param: RabbitUserName}
            barbican::api::rabbit_password: {get_param: RabbitPassword}
            barbican::api::rabbit_port: {get_param: RabbitClientPort}
            barbican::api::rabbit_heartbeat_timeout_threshold: 60
            barbican::api::service_name: 'httpd'
            barbican::wsgi::apache::bind_host: {get_param: [ServiceNetMap, BarbicanApiNetwork]}
            barbican::wsgi::apache::ssl:  {get_param: EnableInternalTLS}
            barbican::wsgi::apache::workers: {get_param: BarbicanWorkers}
            barbican::wsgi::apache::servername:
              str_replace:
                template:
                  "%{hiera('fqdn_$NETWORK')}"
                params:
                  $NETWORK: {get_param: [ServiceNetMap, BarbicanApiNetwork]}
            barbican::db::database_connection:
              make_url:
                scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
                username: barbican
                password: {get_param: BarbicanPassword}
                host: {get_param: [EndpointMap, MysqlInternal, host]}
                path: /barbican
                query:
                  read_default_file: /etc/my.cnf.d/tripleo.cnf
                  read_default_group: tripleo
            tripleo.barbican_api.firewall_rules:
              '117 barbican':
                dport:
                  - 9311
                  - 13311
      step_config: |
        include ::tripleo::profile::base::barbican::api
      service_config_settings:
        mysql:
          barbican::db::mysql::password: {get_param: BarbicanPassword}
          barbican::db::mysql::user: barbican
          barbican::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
          barbican::db::mysql::dbname: barbican
          barbican::db::mysql::allowed_hosts:
            - '%'
            - "%{hiera('mysql_bind_host')}"
        keystone:
          barbican::keystone::auth::public_url: {get_param: [EndpointMap, BarbicanPublic, uri]}
          barbican::keystone::auth::internal_url: {get_param: [EndpointMap, BarbicanInternal, uri]}
          barbican::keystone::auth::admin_url: {get_param: [EndpointMap, BarbicanAdmin, uri]}
          barbican::keystone::auth::password: {get_param: BarbicanPassword}
          barbican::keystone::auth::region: {get_param: KeystoneRegion}
          barbican::keystone::auth::tenant: 'service'
        nova_compute:
          nova::compute::keymgr_api_class: >
            castellan.key_manager.barbican_key_manager.BarbicanKeyManager
          nova::compute::barbican_endpoint:
            get_param: [EndpointMap, BarbicanInternal, uri]
          nova::compute::barbican_auth_endpoint:
            get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]
        cinder_api:
          cinder::api::keymgr_api_class: >
            castellan.key_manager.barbican_key_manager.BarbicanKeyManager
          cinder::api::keymgr_encryption_api_url:
            get_param: [EndpointMap, BarbicanInternal, uri]
          cinder::api::keymgr_encryption_auth_url:
            get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]
      metadata_settings:
        get_attr: [ApacheServiceBase, role_data, metadata_settings]
      upgrade_tasks:
        list_concat:
          - get_attr: [ApacheServiceBase, role_data, upgrade_tasks]
          -
            - name: Check if barbican_api is deployed
              command: systemctl is-enabled openstack-barbican-api
              tags: common
              ignore_errors: True
              register: barbican_api_enabled
            - name: "PreUpgrade step0,validation: Check service openstack-barbican-api is running"
              shell: /usr/bin/systemctl show 'openstack-barbican-api' --property ActiveState | grep '\bactive\b'
              when: barbican_api_enabled.rc == 0
              tags: step0,validation
            - name: Install openstack-barbican-api package if it was disabled
              tags: step3
              yum: name=openstack-barbican-api state=latest
              when: barbican_api_enabled.rc != 0