Ansible列表提供了弃用警告

时间:2017-08-17 14:34:38

标签: ansible

我已经创建了一个用于更新iLO固件的Ansible手册,它运行正常。但是它给了我一个逗号分隔的值,列表已被弃用警告(我的其他剧本都没有给出这个警告)。我假设这必须使用iLO_Models变量,所以我尝试将变量更改为只有一个模型并仍然得到警告。

Ansible版本是2.3.2.0。我只想修复我的代码以删除警告并确保它不会中断。

---
- name: iLO Firmware Upgrade for Standalone Servers
  hosts: testing
  gather_facts: true
  gather_subset: hardware
  become: true
  vars:
    firmware_directory: /firmware
    iLO4: iLO4-2.54-CP032620.scexe
    iLO4_Models:
      - 'ProLiant DL320e Gen8 v2'
      - 'ProLiant DL380 Gen9'
      - 'ProLiant DL580 G9'
      - 'ProLiant BL460c Gen8'
      - 'ProLiant BL460c Gen9'
  tasks:
    - name: Copy iLO4 update
      copy: >
           src={{ firmware_directory }}/{{ iLO4 }}
           dest=/tmp/
           owner=root
           group=root
           mode=0640
      when: ansible_product_name in iLO4_Models

    - name: Install iLO4 Update
      shell: /bin/bash /tmp/{{ iLO4 }} -s
      when: ansible_product_name in iLO4_Models
      register: ilo_result
      changed_when: ilo_result.rc == 0
      failed_when: ilo_result.rc == 1 or ilo_result.rc == 4

我收到以下警告:

[DEPRECATION WARNING]: Using comma separated values for a list has been deprecated. You should instead use the correct YAML syntax for lists. .
This feature will be removed in a future release. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.

1 个答案:

答案 0 :(得分:2)

这是因为var wait = false; $(window).scroll(function() { $('.infoIdentifier').each(function() { var scroll = $(window).scrollTop(); var objectpos = $(this).offset().top - 600; var nextobject = $(this).parent().nextAll('.slideshow').children(".infoIdentifier") if (nextobject.length === 0) { var nextobjectpos = 10000; } else { var nextobjectpos = nextobject.offset().top - 600; } if (!wait && scroll > objectpos && scroll < nextobjectpos) { var $this = $(this).parent('.slideshow'); var $currentSlide = $this.find('.active'); var $nextSlide = $this.children('.jumbotron').first(); $nextSlide.fadeIn(500).addClass('active'); $currentSlide.fadeOut(500).removeClass('active'); wait = true; setTimeout(function() { wait = false; }, 25000); } }); });

替换为:

gather_subset: hardware

或:

gather_subset: [hardware]
相关问题