设为首页 收藏本站
查看: 750|回复: 0

[软件发布] Ansible 2.0 发布,带来全新 OpenStack 模块

[复制链接]

尚未签到

发表于 2016-5-25 06:24:16 | 显示全部楼层 |阅读模式
欢迎加入运维网交流群:263444886   DSC0000.png
  Ansible 2.0 发布,带来的新特性包括:
playbook-level 异常处理,更好的错误检测,一组新的
OpenStack 模块。主要更新如下:
DSC0001.jpg

  *>  * The new block/rescue/always directives allow for making task blocks and exception-like semantics
  * New strategy plugins (e.g. `free`) allow control over the flow of task execution per play. The default (`linear`) will be the same as before.
  * Improved error handling, with more detailed parser messages. General exception handling and display has been revamped.
  * Task includes are now evaluated during execution, allowing more dynamic includes and options. Play includes are unchanged both still use the `include` directive.
  * "with\_" loops can now be used with task includes since they are dynamic.
  * Callback, connection, cache and lookup plugin APIs have changed. Existing plugins might require modification to work with the new versions.
  * Callbacks are now shipped in the active directory and don't need to be copied, just whitelisted in ansible.cfg.
  * Many API changes. Those integrating directly with Ansible's API will encounter breaking changes, but the new API is much easier to use and test.
  * Settings are now more inheritable; what you set at play, block or role will be automatically inherited by the contained tasks.
  This allows for new features to automatically be settable at all levels, previously we had to manually code this.
  * Vars are now settable at play, block, role and task level with the `vars` directive and scoped to the tasks contained.
  * Template code now retains types for bools and numbers instead of turning them into strings.
  If you need the old behaviour, quote the value and it will get passed around as a string
  * Empty variables and variables set to null in yaml will no longer be converted to empty strings.  They will retain the value of `None`.
  To go back to the old behaviour, you can override the `null_representation` setting to an empty string in your config file or
  by setting the `ANSIBLE_NULL_REPRESENTATION` environment variable.
  * Added `meta: refresh_inventory` to force rereading the inventory in a play.
  This re-executes inventory scripts, but does not force them to ignore any cache they might use.
  * New delegate_facts directive, a boolean that allows you to apply facts to the delegated host (true/yes) instead of the inventory_hostname (no/false) which is the default and previous behaviour.
  * local connections now work with 'su' as a privilege escalation method
  * New ssh configuration variables(`ansible_ssh_common_args`, `ansible_ssh_extra_args`) can be used to configure a
  per-group or per-host ssh ProxyCommand or set any other ssh options.
  `ansible_ssh_extra_args` is used to set options that are accepted only by ssh (not sftp or scp, which have their own analogous settings).
  * ansible-pull can now verify the code it runs when using git as a source repository, using git's code signing and verification features.
  * Backslashes used when specifying parameters in jinja2 expressions in YAML dicts sometimes needed to be escaped twice.
  This has been fixed so that escaping once works. Here's an example of how playbooks need to be modified:
  
 ```  
    # Syntax in 1.9.x
  
    - debug:
  
        msg: "{{ 'test1_junk 1\\\\3' | regex_replace('(.*)_junk (.*)', '\\\\1 \\\\2') }}"
  
    # Syntax in 2.0.x
  
    - debug:
  
        msg: "{{ 'test1_junk 1\\3' | regex_replace('(.*)_junk (.*)', '\\1 \\2') }}"
  
    # Output:
  
    "msg": "test1 1\\3"
  
    ```
  * When a string with a trailing newline was specified in the playbook via yaml
  dict format, the trailing newline was stripped. When specified in key=value
  format the trailing newlines were kept. In v2, both methods of specifying the

  string will keep the trailing newlines. If you>  newline being stripped you can change your playbook like this:
  
  
    ```
  
    # Syntax in 1.9.2
  
    vars:
  
      message: >
  
        Testing
  
        some things
  
    tasks:
  
    - debug:
  
        msg: "{{ message }}"
  
    # Syntax in 2.0.x
  
    vars:
  
      old_message: >
  
        Testing
  
        some things
  
      message: "{{ old_messsage[:-1] }}"
  
    - debug:
  
        msg: "{{ message }}"
  
    # Output
  
    "msg": "Testing some things"
  
    ```
  * When specifying complex args as a variable, the variable must use the full jinja2
  variable syntax ('{{var_name}}') - bare variable names there are no longer accepted.
  In fact, even specifying args with variables has been deprecated, and will not be
  allowed in future versions:
  
   ```  
    ---
  
    - hosts: localhost
  
      connection: local
  
      gather_facts: false
  
      vars:
  
        my_dirs:
  
          - { path: /tmp/3a, state: directory, mode: 0755 }
  
          - { path: /tmp/3b, state: directory, mode: 0700 }
  
      tasks:
  
        - file:
  
          args: "{{item}}"
  
          with_items: my_dirs
  
    ```
  * The bigip\* networking modules have a new parameter, validate_certs.  When
  True (the default) the module will validate any hosts it connects to against
  the TLS certificates it presents when run on new enough python versions.  If
  the python version is too old to validate certificates or you used certificates
  that cannot be validated against available CAs you will need to add
  validate_certs=no to your playbook for those tasks.
  
  更多内容请看: the
changelog
  
  发行说明:Version 2.0
  Ansible 提供一种最简单的方式用于发布、管理和编排计算机系统的工具,你可在数分钟内搞定。
  Ansible 是一个模型驱动的配置管理器,支持多节点发布、远程任务执行。默认使用 SSH 进行远程连接。无需在被管理节点上安装附加软件,可使用各种编程语言进行扩展。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-221324-1-1.html 上篇帖子: 蝉知 5.1 发布,增加布局方案跨主题应用功能 下篇帖子: Linux Lite 2.8 Beta 发布,致敬 Ian Murdock
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表