4.7. Puppet: 사용자 정의 매니페스트 적용

특정 상황에서는 오버클라우드 노드에 일부 추가 구성 요소를 설치하고 구성할 수 있습니다. 기본 구성이 완료된 후 노드에 적용되는 사용자 정의 Puppet 매니페스트를 사용하여 이 작업을 수행할 수 있습니다. 기본 예에서는 각 노드에 motd 를 설치할 수 있습니다.

절차

  1. Puppet 구성을 시작하는 heat 템플릿 ~/templates/custom_puppet_config.yaml 을 생성합니다.

    heat_template_version: 2014-10-16
    
    description: >
      Run Puppet extra configuration to set new MOTD
    
    parameters:
      servers:
        type: json
      DeployIdentifier:
        type: string
      EndpointMap:
        default: {}
        type: json
    
    resources:
      ExtraPuppetConfig:
        type: OS::Heat::SoftwareConfig
        properties:
          config: {get_file: motd.pp}
          group: puppet
          options:
            enable_hiera: True
            enable_facter: False
    
      ExtraPuppetDeployments:
        type: OS::Heat::SoftwareDeploymentGroup
        properties:
          config: {get_resource: ExtraPuppetConfig}
          servers: {get_param: servers}

    이 예제에는 템플릿에 /home/stack/templates/motd.pp 이 포함되어 있으며 구성을 위해 노드에 전달합니다. motd.pp 파일에는 motd를 설치하고 구성하는 데 필요한 Puppet 클래스가 포함되어 있습니다 .

  2. heat 템플릿을 OS::TripleO::NodeExtraConfigPost: 리소스 유형으로 등록하는 환경 파일 ~templates/puppet_post_config.yaml 을 생성합니다.

    resource_registry:
      OS::TripleO::NodeExtraConfigPost: /home/stack/templates/custom_puppet_config.yaml
  3. 배포와 관련된 기타 환경 파일과 함께 openstack overcloud deploy 명령에 이 환경 파일을 포함합니다.

    $ openstack overcloud deploy --templates \
        ...
        -e /home/stack/templates/puppet_post_config.yaml \
        ...

    그러면 motd.pp 의 구성이 오버클라우드의 모든 노드에 적용됩니다.