<commit_before>heat_template_version: rocky

description: Host config and reboot service which configures Kernel Args and reboot

parameters:
  RoleNetIpMap:
    default: {}
    type: json
  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
  KernelArgs:
    default: ""
    type: string
    description: Kernel Args to apply to the host
    tags:
      - role_specific
  TunedProfileName:
    default: 'throughput-performance'
    type: string
    description: Tuned Profile to apply to the host
    tags:
      - role_specific
  IsolCpusList:
    default: ""
    type: string
    description: >
      List of logical CPU ids whic need to be isolated from the host processes.
      This input is provided to the tuned profile cpu-partitioning to configure
      systemd and repin interrupts (IRQ repinning).
    tags:
      - role_specific
  NodeRebootWaitTimeout:
    default: 900
    type: number
    description: Timeout in seconds to specify the wait time for ansible node reboot

resources:
  RoleParametersValue:
    type: OS::Heat::Value
    properties:
      type: json
      value:
        map_replace:
          - map_replace:
            - tuned_profile: TunedProfileName
              isolated_cores: IsolCpusList
              kernel_args: KernelArgs
            - values: {get_param: [RoleParameters]}
          - values:
              TunedProfileName: {get_param: TunedProfileName}
              IsolCpusList: {get_param: IsolCpusList}
              KernelArgs: {get_param: KernelArgs}

outputs:
  role_data:
    description: Role data for the Host Config Service
    value:
      service_name: boot_params_service
      deploy_steps_tasks:
        # TODO(skramaja): Tasks of Tuned TripleO service can be used here
        # But the configuration in that service has to be moved from host_prep_tasks to step 0 of deploy_step_tasks
        - name: Configure tuned before reboot
          when: step|int == 0
          import_role:
            name: tuned
          vars:
            tuned_profile: {get_attr: [RoleParametersValue, value, tuned_profile]}
            tuned_isolated_cores: {get_attr: [RoleParametersValue, value, isolated_cores]}
        - name: Configure kernel args and reboot
          when: step|int == 0
          import_role:
            name: tripleo-kernel
            tasks_from: kernelargs.yml
          vars:
            tripleo_kernel_args: {get_attr: [RoleParametersValue, value, kernel_args]}
            tripleo_kernel_reboot_timeout: {get_param: NodeRebootWaitTimeout}<commit_msg>Modify import_role to include_role for boot params service<commit_after>heat_template_version: rocky

description: Host config and reboot service which configures Kernel Args and reboot

parameters:
  RoleNetIpMap:
    default: {}
    type: json
  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
  KernelArgs:
    default: ""
    type: string
    description: Kernel Args to apply to the host
    tags:
      - role_specific
  TunedProfileName:
    default: 'throughput-performance'
    type: string
    description: Tuned Profile to apply to the host
    tags:
      - role_specific
  IsolCpusList:
    default: ""
    type: string
    description: >
      List of logical CPU ids whic need to be isolated from the host processes.
      This input is provided to the tuned profile cpu-partitioning to configure
      systemd and repin interrupts (IRQ repinning).
    tags:
      - role_specific
  NodeRebootWaitTimeout:
    default: 900
    type: number
    description: Timeout in seconds to specify the wait time for ansible node reboot

resources:
  RoleParametersValue:
    type: OS::Heat::Value
    properties:
      type: json
      value:
        map_replace:
          - map_replace:
            - tuned_profile: TunedProfileName
              isolated_cores: IsolCpusList
              kernel_args: KernelArgs
            - values: {get_param: [RoleParameters]}
          - values:
              TunedProfileName: {get_param: TunedProfileName}
              IsolCpusList: {get_param: IsolCpusList}
              KernelArgs: {get_param: KernelArgs}

outputs:
  role_data:
    description: Role data for the Host Config Service
    value:
      service_name: boot_params_service
      deploy_steps_tasks:
        # TODO(skramaja): Tasks of Tuned TripleO service can be used here
        # But the configuration in that service has to be moved from host_prep_tasks to step 0 of deploy_step_tasks
        - name: Configure tuned before reboot
          when: step|int == 0
          include_role:
            name: tuned
          vars:
            tuned_profile: {get_attr: [RoleParametersValue, value, tuned_profile]}
            tuned_isolated_cores: {get_attr: [RoleParametersValue, value, isolated_cores]}
        - name: Configure kernel args and reboot
          when: step|int == 0
          include_role:
            name: tripleo-kernel
            tasks_from: kernelargs.yml
          vars:
            tripleo_kernel_args: {get_attr: [RoleParametersValue, value, kernel_args]}
            tripleo_kernel_reboot_timeout: {get_param: NodeRebootWaitTimeout}
{'fraction_non_alphanumeric': 0.057151542787657696, 'fraction_numerical': 0.001823985408116735, 'mean_word_length': 2.503727369542066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3869745', 'n_tokens_mistral': 1791, 'n_tokens_neox': 1739, 'n_words': 600}