Need this basic ansible variables explaination -
i know really basic question, want explanation of this:
repos: - name: 'epel' url: 'http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm' key: 'http://ftp.riken.jp/linux/fedora/epel/rpm-gpg-key-epel-6' - name: 'rpmforge' url: 'http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm' key: 'http://apt.sw.be/rpm-gpg-key.dag.txt' - name: 'remi' url: 'http://rpms.famillecollet.com/enterprise/remi-release-6.rpm' key: 'http://rpms.famillecollet.com/rpm-gpg-key-remi' - name: 'webtatic' url: 'http://mirror.webtatic.com/yum/el6/latest.rpm' key: 'http://mirror.webtatic.com/yum/rpm-gpg-key-webtatic-andy'
like "repo", think it's list? "name", "url" , "key"? , why "name" has "-" infront of it?
thanks in advance
perhaps helps if @ in terms of python
dict
, list
:
$ python -c " import yaml import pprint pp = pprint.prettyprinter(indent=3); x = yaml.load('''repos: - name: 'epel' url: 'http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm' key: 'http://ftp.riken.jp/linux/fedora/epel/rpm-gpg-key-epel-6' - name: 'rpmforge' url: 'http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm' key: 'http://apt.sw.be/rpm-gpg-key.dag.txt' - name: 'remi' url: 'http://rpms.famillecollet.com/enterprise/remi-release-6.rpm' key: 'http://rpms.famillecollet.com/rpm-gpg-key-remi' - name: 'webtatic' url: 'http://mirror.webtatic.com/yum/el6/latest.rpm' key: 'http://mirror.webtatic.com/yum/rpm-gpg-key-webtatic-andy' '''); pp.pprint( x );" { 'repos': [ { 'key': 'http://ftp.riken.jp/linux/fedora/epel/rpm-gpg-key-epel-6', 'name': 'epel', 'url': 'http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'}, { 'key': 'http://apt.sw.be/rpm-gpg-key.dag.txt', 'name': 'rpmforge', 'url': 'http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm'}, { 'key': 'http://rpms.famillecollet.com/rpm-gpg-key-remi', 'name': 'remi', 'url': 'http://rpms.famillecollet.com/enterprise/remi-release-6.rpm'}, { 'key': 'http://mirror.webtatic.com/yum/rpm-gpg-key-webtatic-andy', 'name': 'webtatic', 'url': 'http://mirror.webtatic.com/yum/el6/latest.rpm'}]} $
so:
repos
element (key) indict
- value key
repos
list
ofdicts
why "name" has "-" infront of it?
invalid question. that's yaml syntax, when want declare dict
, that's how it.
o , marc said read: ansible yaml syntax
Comments
Post a Comment