Opensourcetechブログ

OpensourcetechによるNGINX/Kubernetes/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

Ansible.cfgやPlaybookにおけるコメントの書き方

 

こんにちは、LinuCエバンジェリストこと、鯨井貴博@opensourcetechです。

 

Ansibleの設定ファイルやPlaybookにおける、コメントの書き方に関するメモです。

 

 

コメントの書き方

行全体をコメントにする場合は、先頭に「#(シャープ)」をつける、

行の指定箇所以降をコメントにする場合は、「;(セミコロン)」をつけます。

f:id:opensourcetech:20181005183259p:plain

Configuration file — Ansible Documentation

 

 設定サンプル(yaml形式のPlaybook)

---
- hosts: junos
# strategy: debug
# debugger: always
gather_facts: no
connection: netconf

tasks:

- name: set services
junos_config:
lines:
- set system services ftp
# provider: "{{ param }}"
# provider:
# timeout: 30

- name: show conf ; checking change configuration
junos_command:
commands:
- show configuration
register: result

 

 

 

www.slideshare.net

github.com

www.facebook.com

twitter.com

www.instagram.com

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

 

 

Opensourcetech by Takahiro Kujirai