exastro-suite / exastro-it-automation

Apache License 2.0
3 stars 19 forks source link

【収集】比較対象で、同一ファイル名の収集ができない。 #2562

Closed y-yonekura closed 2 months ago

y-yonekura commented 2 months ago

バグの説明

収集で、同一ファイル名の収集を行う場合、パスでの指定が可能だが、 パス指定時に収集すると登録処理でエラーとなる。

再現方法

1.作業実行に必要なパラメータシート作成、データの登録、収集に必要な設定を登録する。 同一ファイルを収集するPlaybookを使用して作業実行。

収集項目値「収集項目(From)」の設定例:  YAML  Ansible_conf  ansible_config_output or ansible_config_output_2

本来期待する挙動

パス指定でのファイル名での収集できること。 ansible_config_output: Ansible_conf.yml ansible_config_output_2: /aaa/Ansible_conf.yml

動作環境

追加の項目

収集済み(通知あり):CollectData_46fcb226-5870-444f-ab74-8eadcdffdfff.log

Collect START (host name: exastro-test-1 file name: ['Ansible_conf'])
{'item_3': [{'status_code': '', 'msg_args': '', 'msg': 'Regular expression error (^[^,\\"\\t\\/\\r\\n]*$,Value:/aaa/Ansible_conf.yml)'}]}
[Process] Failed to register or update data in CMDB. (1/1)

サンプルPlaybook:makeYml_Ansible.yml

- name: make yaml file
  blockinfile:
    create: yes
    mode: 777
    insertbefore: EOF
    marker: ""
    dest: "/tmp/Ansible_conf.yml"
    content: |
      ansible_architecture: {{ ansible_architecture }}
      ansible_bios_version: {{ ansible_bios_version }}
      ansible_default_ipv4__address: {{ ansible_default_ipv4.address }}
      ansible_default_ipv4__interface: {{ ansible_default_ipv4.interface }}
      ansible_default_ipv4__network: {{ ansible_default_ipv4.network }}
      ansible_distribution: {{ ansible_distribution }}
      ansible_distribution_file_path: {{ ansible_distribution_file_path }}
      ansible_distribution_file_variety: {{ ansible_distribution_file_variety }}
      ansible_distribution_major_version: {{ ansible_distribution_major_version }}
      ansible_distribution_release: {{ ansible_distribution_release }}
      ansible_distribution_version: {{ ansible_distribution_version }}
      ansible_machine: {{ ansible_machine }}
      ansible_memtotal_mb: {{ ansible_memtotal_mb }}
      ansible_nodename: {{ ansible_nodename }}
      ansible_os_family: {{ ansible_os_family }}
      ansible_pkg_mgr: {{ ansible_pkg_mgr }}
      ansible_processor_cores: {{ ansible_processor_cores }}
      ansible_processor_count: {{ ansible_processor_count }}
      ansible_processor_threads_per_core: {{ ansible_processor_threads_per_core }}
      ansible_processor_vcpus: {{ ansible_processor_vcpus }}
      ansible_product_name: {{ ansible_product_name }}
      ansible_product_serial: {{ ansible_product_serial }}
      ansible_product_uuid: {{ ansible_product_uuid }}
      ansible_product_version: {{ ansible_product_version }}
      ansible_python__executable: {{ ansible_python.executable }}
      ansible_python_version: {{ ansible_python_version }}
      ansible_service_mgr: {{ ansible_service_mgr }}
      ansible_config_output: Ansible_conf.yml
      ansible_config_output_2: /aaa/Ansible_conf.yml
      pulldown_ja: "Ansible-Legacy:Movement-Playbook紐付"
      pulldown_en: "Ansible-Legacy:Movement playbook link"

- name: make yaml file aaa
  blockinfile:
    create: yes
    mode: 777
    insertbefore: EOF
    marker: ""
    dest: "/tmp/aaa/Ansible_conf.yml"
    content: |
      ansible_config_output_2: /aaa/Ansible_conf.yml

- name: Copy the make yaml file to local
  fetch:
    src: "/tmp/Ansible_conf.yml"
    dest: "{{ __parameter_dir__ }}/{{ inventory_hostname }}/"
    flat: yes

- name: Copy the make file to local
  fetch:
    src: "/tmp/Ansible_conf.yml"
    dest: "{{ __parameters_file_dir__ }}/{{ inventory_hostname }}/"
    flat: yes

- name: Copy the make file to local aaa
  fetch:
    src: "/tmp/aaa/Ansible_conf.yml"
    dest: "{{ __parameters_file_dir__ }}/{{ inventory_hostname }}/aaa/"
    flat: yes