ansible-playbook ansible-yum_repository 写入控制台
ansible-playbook ansible-yum_repository writing to console
我有一个剧本可以做到这一点:
- name: Add Copr Yum Repository
yum_repository:
name: czanik-syslog-ng-githead
description: Copr repo for syslog-ng-githead owned by czanik
baseurl: https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/epel-7-$basearch/
skip_if_unavailable: yes
gpgkey: https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/pubkey.gpg
repo_gpgcheck: no
enabled: yes
我 运行 我每 15 分钟从 cron 看一次我的剧本,每 15 分钟我看到这个 ...
2019 Feb 16 20:45:31 sa-tool-001.example.com ansible-yum_repository Invoked with force=None directory_mode=None ip_resolve=None remote_src=None reposdir=/etc/yum.repos.d includepkgs=None owner=None bandwidth=None cost=None file=None exclude=None mirrorlist_expire=None follow=False attributes=None keepalive=None content=NOT_LOGGING_PARAMETER repo_gpgcheck=False src=None group=None failovermethod=None unsafe_writes=None delimiter=None deltarpm_metadata_percentage=None gpgkey=['https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/pubkey.gpg'] setype=None http_caching=None priority=None serole=None mirrorlist=None params=None gpgcheck=None include=None proxy_username=None username=None metadata_expire=None description=Copr repo for syslog-ng-githead owned by czanik ui_repoid_vars=None selevel=None sslclientcert=None baseurl=['https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/epel-7-$basearch/'] gpgcakey=None sslverify=None s3_enabled=None state=present sslcacert=None proxy_password=NOT_LOGGING_PARAMETER enablegroups=None regexp=None password=NOT_LOGGING_PARAMETER seuser=None retries=None protect=None ssl_check_cert_permissions=None throttle=None name=czanik-syslog-ng-githead deltarpm_percentage=None sslclientkey=None metalink=None enabled=True skip_if_unavailable=True keepcache=None mode=None timeout=None async=None metadata_expire_filter=None backup=None proxy=None
...写入控制台。这非常烦人,尤其是当您以根用户身份编辑文件或拖尾某些日志文件的输出时。我如何让它停止?
在任务中设置no_log: True
。这样,Ansible 就不会记录任务
- name: Add Copr Yum Repository
yum_repository:
name: czanik-syslog-ng-githead
description: Copr repo for syslog-ng-githead owned by czanik
baseurl: https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/epel-7-$basearch/
skip_if_unavailable: yes
gpgkey: https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/pubkey.gpg
repo_gpgcheck: no
enabled: yes
no_log: True
您必须为整个 task
设置变量,而不是 特定的 yum 模块。
我有一个剧本可以做到这一点:
- name: Add Copr Yum Repository
yum_repository:
name: czanik-syslog-ng-githead
description: Copr repo for syslog-ng-githead owned by czanik
baseurl: https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/epel-7-$basearch/
skip_if_unavailable: yes
gpgkey: https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/pubkey.gpg
repo_gpgcheck: no
enabled: yes
我 运行 我每 15 分钟从 cron 看一次我的剧本,每 15 分钟我看到这个 ...
2019 Feb 16 20:45:31 sa-tool-001.example.com ansible-yum_repository Invoked with force=None directory_mode=None ip_resolve=None remote_src=None reposdir=/etc/yum.repos.d includepkgs=None owner=None bandwidth=None cost=None file=None exclude=None mirrorlist_expire=None follow=False attributes=None keepalive=None content=NOT_LOGGING_PARAMETER repo_gpgcheck=False src=None group=None failovermethod=None unsafe_writes=None delimiter=None deltarpm_metadata_percentage=None gpgkey=['https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/pubkey.gpg'] setype=None http_caching=None priority=None serole=None mirrorlist=None params=None gpgcheck=None include=None proxy_username=None username=None metadata_expire=None description=Copr repo for syslog-ng-githead owned by czanik ui_repoid_vars=None selevel=None sslclientcert=None baseurl=['https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/epel-7-$basearch/'] gpgcakey=None sslverify=None s3_enabled=None state=present sslcacert=None proxy_password=NOT_LOGGING_PARAMETER enablegroups=None regexp=None password=NOT_LOGGING_PARAMETER seuser=None retries=None protect=None ssl_check_cert_permissions=None throttle=None name=czanik-syslog-ng-githead deltarpm_percentage=None sslclientkey=None metalink=None enabled=True skip_if_unavailable=True keepcache=None mode=None timeout=None async=None metadata_expire_filter=None backup=None proxy=None
...写入控制台。这非常烦人,尤其是当您以根用户身份编辑文件或拖尾某些日志文件的输出时。我如何让它停止?
在任务中设置no_log: True
。这样,Ansible 就不会记录任务
- name: Add Copr Yum Repository
yum_repository:
name: czanik-syslog-ng-githead
description: Copr repo for syslog-ng-githead owned by czanik
baseurl: https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/epel-7-$basearch/
skip_if_unavailable: yes
gpgkey: https://copr-be.cloud.fedoraproject.org/results/czanik/syslog-ng-githead/pubkey.gpg
repo_gpgcheck: no
enabled: yes
no_log: True
您必须为整个 task
设置变量,而不是 特定的 yum 模块。