{"id":7306,"date":"2018-03-31T23:23:35","date_gmt":"2018-03-31T15:23:35","guid":{"rendered":"http:\/\/rmohan.com\/?p=7306"},"modified":"2018-03-31T23:23:35","modified_gmt":"2018-03-31T15:23:35","slug":"ansible-playbooks-one-of-the-following-is-required-name-list","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7306","title":{"rendered":"ansible-playbooks one of the following is required name list"},"content":{"rendered":"<p>Ansible implementation of one of the following is required: name,list<\/p>\n<h1 id=\"??playbooks\">Perform playbooks<\/h1>\n<figure class=\"highlight sh\">\n<div class=\"table-area\">[root@controller playbook]# ansible-playbook package.yaml<\/div>\n<\/figure>\n<h1 id=\"????\">Error message<\/h1>\n<figure class=\"highlight sh\">\n<div class=\"table-area\">\n<p>[root@controller playbook]# ansible-playbook package.yaml<br \/>\n[WARNING]: While constructing a mapping from \/root\/ansible\/playbook\/package.yaml, line 11, column 5, found a duplicate dict key (name). Using last defined value only.<\/p>\n<p>[WARNING]: Ignoring invalid attribute: state<\/p>\n<p>PLAY [app] ****************************************************************************************************************************************************************************************************************************************************************<\/p>\n<p>TASK [Gathering Facts] ****************************************************************************************************************************************************************************************************************************************************<br \/>\nok: [node2.rmohan.com]<\/p>\n<p>TASK [Upgrade all packages] ***********************************************************************************************************************************************************************************************************************************************<br \/>\nok: [node2.rmohan.com]<\/p>\n<p>TASK [install epel-release] ***********************************************************************************************************************************************************************************************************************************************<br \/>\nskipping: [node2.rmohan.com]<\/p>\n<p>TASK [{{ item }}] *********************************************************************************************************************************************************************************************************************************************************<br \/>\nfailed: [node2.rmohan.com] (item=libselinux-python) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;libselinux-python&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=docker-python) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;docker-python&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=python-yaml) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;python-yaml&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=net-tools) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;net-tools&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=nfs-utils) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;nfs-utils&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=mc) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;mc&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=vim) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;vim&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=wget) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;wget&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=git) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;git&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=ntp) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;ntp&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=telnet) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;telnet&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=mtr) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;mtr&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=htop) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;htop&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=iotop) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;iotop&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nfailed: [node2.rmohan.com] (item=mailx) =&gt; {&#8220;changed&#8221;: false, &#8220;item&#8221;: &#8220;mailx&#8221;, &#8220;msg&#8221;: &#8220;one of the following is required: name,list&#8221;}<br \/>\nto retry, use: &#8211;limit @\/root\/ansible\/playbook\/package.retry<\/p>\n<p>PLAY RECAP ****************************************************************************************************************************************************************************************************************************************************************<br \/>\nnode2.rmohan.com : ok=2 changed=0 unreachable=0 failed=1<\/p>\n<\/div>\n<\/figure>\n<h1 id=\"playbooks??\">Playbooks written<\/h1>\n<figure class=\"highlight sh\">\n<div class=\"table-area\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"line\">&#8211; name: Install zabbix agent<\/div>\n<div class=\"line\">yum: name={{item}} state=present<\/div>\n<div class=\"line\">with_items:<\/div>\n<div class=\"line\">&#8211; libselinux-python<br \/>\n&#8211; docker-python<br \/>\n&#8211; python-yaml<br \/>\n&#8211; net-tools<br \/>\n&#8211; nfs-utils<br \/>\n&#8211; mc<br \/>\n&#8211; vim<br \/>\n&#8211; wget<br \/>\n&#8211; git<br \/>\n&#8211; ntp<br \/>\n&#8211; telnet<br \/>\n&#8211; mtr<br \/>\n&#8211; htop<br \/>\n&#8211; iotop<br \/>\n&#8211; mailx<br \/>\ntags: install<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/figure>\n<h1 id=\"??\">Troubleshoot<\/h1>\n<blockquote><p>Carefully looked down and found no spaces, no spaces, no spaces.\u00a0Change it to something like this<\/p><\/blockquote>\n<figure class=\"highlight sh\">\n<div class=\"table-area\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"line\">&#8211; name: Install zabbix agent<\/div>\n<div class=\"line\">yum: name={{ item }} state=present<\/div>\n<div class=\"line\">&#8211; name: Install system packages.<br \/>\nyum: name={{ item }} state=present<br \/>\nwith_items:<br \/>\n&#8211; libselinux-python<br \/>\n&#8211; docker-python<br \/>\n&#8211; python-yaml<br \/>\n&#8211; net-tools<br \/>\n&#8211; nfs-utils<br \/>\n&#8211; mc<br \/>\n&#8211; vim<br \/>\n&#8211; wget<br \/>\n&#8211; git<br \/>\n&#8211; ntp<br \/>\n&#8211; telnet<br \/>\n&#8211; mtr<br \/>\n&#8211; htop<br \/>\n&#8211; iotop<br \/>\n&#8211; mailx<br \/>\ntags: install<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Ansible implementation of one of the following is required: name,list<\/p>\n<p> Perform playbooks [root@controller playbook]# ansible-playbook package.yaml Error message <\/p>\n<p>[root@controller playbook]# ansible-playbook package.yaml [WARNING]: While constructing a mapping from \/root\/ansible\/playbook\/package.yaml, line 11, column 5, found a duplicate dict key (name). Using last defined value only.<\/p>\n<p>[WARNING]: Ignoring invalid attribute: state<\/p>\n<p>PLAY [app] ****************************************************************************************************************************************************************************************************************************************************************<\/p>\n<p>TASK [Gathering Facts] [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7306"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7306"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7306\/revisions"}],"predecessor-version":[{"id":7307,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7306\/revisions\/7307"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}