summaryrefslogtreecommitdiffstats
path: root/deploy/config/__init__.py
blob: e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (plain)

e81ff } /* 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 EC2-API service configured with Puppet

parameters:
  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
  Ec2ApiWorkers:
    default: 0
    description: Number of workers for EC2-API service.
    type: number
  Ec2ApiPassword:
    description: The password for the nova service and db account, used by nova-api.
    type: string
    hidden: true
  KeystoneRegion:
    type: string
    default: 'regionOne'
    description: Keystone region for endpoint
  Ec2ApiExternalNetwork:
    type: string
    default: ''
    description: Name of the external network, which is used to connect VPCs to
                 Internet and to allocate Elastic IPs
  NovaDefaultFloatingPool:
    default: 'public'
    description: Default pool for floating IP addresses
    type: string
  MonitoringSubscriptionEc2Api:
    default: 'overcloud-ec2-api'
    type: string
  Ec2ApiLoggingSource:
    type: json
    default:
      tag: openstack.ec2.api
      path: /var/log/ec2api/ec2api.log
  EnablePackageInstall:
    default: 'false'
    description: Set to true to enable package installation via Puppet
    type: boolean
  Ec2ApiPolicies:
    description: |
      A hash of policies to configure for EC2-API.
      e.g. { ec2api-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
    default: {}
    type: json


conditions:
  nova_workers_zero: {equals : [{get_param: Ec2ApiWorkers}, 0]}
  external_network_unset: {equals : [{get_param: Ec2ApiExternalNetwork}, '']}

outputs:
  role_data:
    description: Role data for the EC2-API service.
    value:
      service_name: ec2_api
      monitoring_subscription: {get_param: MonitoringSubscriptionEc2Api}
      logging_source: {get_param: Ec2ApiLoggingSource}
      logging_groups:
        - nova
      config_settings:
        map_merge:
        - tripleo.ec2_api.firewall_rules:
            '113 ec2_api':
              dport:
                - 8788
                - 13788
          ec2api::keystone::authtoken::project_name: 'service'
          ec2api::keystone::authtoken::password: {get_param: Ec2ApiPassword}
          ec2api::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri] }
          ec2api::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
          ec2api::policy::policies: {get_param: Ec2ApiPolicies}
          ec2api::api::enabled: true
          ec2api::package_manage: {get_param: EnablePackageInstall}
          ec2api::api::ec2api_listen:
            str_replace:
              template:
                "%{hiera('fqdn_$NETWORK')}"
              params:
                $NETWORK: {get_param: [ServiceNetMap, Ec2ApiNetwork]}
          ec2api::metadata::metadata_listen:
            str_replace:
              template:
                "%{hiera('fqdn_$NETWORK')}"
              params:
                $NETWORK: {get_param: [ServiceNetMap, Ec2ApiMetadataNetwork]}
          ec2api::db::database_connection:
            make_url:
              scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
              username: ec2_api
              password: {get_param: Ec2ApiPassword}
              host: {get_param: [EndpointMap, MysqlInternal, host]}
              path: /ec2_api
              query:
                read_default_file: /etc/my.cnf.d/tripleo.cnf
                read_default_group: tripleo
          ec2api::api::keystone_ec2_tokens_url:
            list_join:
              - ''
              - - {get_param: [EndpointMap, KeystoneV3Internal, uri]}
                - '/ec2tokens'
        -
          if:
          - nova_workers_zero
          - {}
          - ec2api::api::ec2api_workers: {get_param: Ec2ApiWorkers}
            ec2api::metadata::metadata_workers: {get_param: Ec2ApiWorkers}
        -
          if:
          - external_network_unset
          - ec2api::api::external_network: {get_param: NovaDefaultFloatingPool}
          - ec2api::api::external_network: {get_param: Ec2ApiExternalNetwork}
      step_config: |
        include tripleo::profile::base::nova::ec2api
      service_config_settings:
        keystone:
          ec2api::keystone::auth::tenant: 'service'
          ec2api::keystone::auth::public_url: {get_param: [EndpointMap, Ec2ApiPublic, uri]}
          ec2api::keystone::auth::internal_url: {get_param: [EndpointMap, Ec2ApiInternal, uri]}
          ec2api::keystone::auth::admin_url: {get_param: [EndpointMap, Ec2ApiAdmin, uri]}
          ec2api::keystone::auth::password: {get_param: Ec2ApiPassword}
          ec2api::keystone::auth::region: {get_param: KeystoneRegion}
        mysql:
          ec2api::db::mysql::password: {get_param: Ec2ApiPassword}
          ec2api::db::mysql::user: ec2_api
          ec2api::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
          ec2api::db::mysql::dbname: ec2_api
          ec2api::db::mysql::allowed_hosts:
            - '%'
            - "%{hiera('mysql_bind_host')}"
      upgrade_tasks:
        - name: Check if ec2-api is deployed
          command: systemctl is-enabled openstack-ec2-api
          tags: common
          ignore_errors: True
          register: ec2_api_enabled
        - name: "PreUpgrade step0,validation: Check if openstack-ec2-api is running"
          shell: >
            /usr/bin/systemctl show 'openstack-ec2-api' --property ActiveState |
            grep '\bactive\b'
          when: ec2_api_enabled.rc == 0
          tags: step0,validation
        - name: Stop openstack-ec2-api service
          tags: step1
          when: ec2_api_enabled.rc == 0
          service: name=openstack-ec2-api state=stopped
        - name: Install openstack-ec2-api package if it was disabled
          tags: step3
          yum: name=openstack-ec2-api state=latest
          when: ec2_api_enabled.rc != 0