質問編集履歴
3
ansible オプションを `-vvvv` に変更しました。
    
        title	
    CHANGED
    
    | 
            File without changes
         | 
    
        body	
    CHANGED
    
    | @@ -20,16 +20,33 @@ | |
| 20 20 | 
             
            ```
         | 
| 21 21 |  | 
| 22 22 | 
             
            ```
         | 
| 23 | 
            -
            [root@localhost ansible]# ansible-playbook test.yml --limit=vagrant --connection=local - | 
| 23 | 
            +
            [root@localhost ansible]# ansible-playbook test.yml --limit=vagrant --connection=local -vvvv
         | 
| 24 24 | 
             
            Using /vagrant/ansible/ansible.cfg as config file
         | 
| 25 | 
            +
            Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc
         | 
| 25 26 |  | 
| 27 | 
            +
            PLAYBOOK: test.yml *************************************************************
         | 
| 28 | 
            +
            1 plays in test.yml
         | 
| 29 | 
            +
             | 
| 26 30 | 
             
            PLAY [all] *********************************************************************
         | 
| 27 31 |  | 
| 28 32 | 
             
            TASK [setup] *******************************************************************
         | 
| 33 | 
            +
            Using module file /usr/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
         | 
| 34 | 
            +
            <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
         | 
| 35 | 
            +
            <127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728 `" && echo ansible-tmp-1479267155.59-84022657785728="` echo $HOME/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728 `" ) && sleep 0'
         | 
| 36 | 
            +
            <127.0.0.1> PUT /tmp/tmpKJgvMU TO /root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/setup.py
         | 
| 37 | 
            +
            <127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/ /root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/setup.py && sleep 0'
         | 
| 38 | 
            +
            <127.0.0.1> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/setup.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1479267155.59-84022657785728/" > /dev/null 2>&1 && sleep 0'
         | 
| 29 39 | 
             
            ok: [127.0.0.1]
         | 
| 30 40 |  | 
| 31 41 | 
             
            TASK [test : create groups debug] **********************************************
         | 
| 42 | 
            +
            task path: /vagrant/ansible/roles/test/tasks/main.yml:2
         | 
| 32 43 | 
             
            ok: [127.0.0.1] => (item=user_groups) => {
         | 
| 44 | 
            +
                "invocation": {
         | 
| 45 | 
            +
                    "module_args": {
         | 
| 46 | 
            +
                        "var": "user_groups"
         | 
| 47 | 
            +
                    },
         | 
| 48 | 
            +
                    "module_name": "debug"
         | 
| 49 | 
            +
                },
         | 
| 33 50 | 
             
                "item": "user_groups",
         | 
| 34 51 | 
             
                "user_groups": [
         | 
| 35 52 | 
             
                    {
         | 
| @@ -48,11 +65,17 @@ | |
| 48 65 | 
             
            }
         | 
| 49 66 |  | 
| 50 67 | 
             
            TASK [test : create groups debug] **********************************************
         | 
| 51 | 
            -
             | 
| 68 | 
            +
            task path: /vagrant/ansible/roles/test/tasks/main.yml:7
         | 
| 69 | 
            +
            fatal: [127.0.0.1]: FAILED! => {
         | 
| 70 | 
            +
                "failed": true,
         | 
| 71 | 
            +
                "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'unicode object' has no attribute 'gid'\n\nThe error appears to have been in '/vagrant/ansible/roles/test/tasks/main.yml': line 7, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: create groups debug\n  ^ here\n"
         | 
| 72 | 
            +
            }
         | 
| 52 73 | 
             
                   	to retry, use: --limit @/vagrant/ansible/test.retry
         | 
| 53 74 |  | 
| 54 75 | 
             
            PLAY RECAP *********************************************************************
         | 
| 55 76 | 
             
            127.0.0.1                  : ok=2    changed=0    unreachable=0    failed=1
         | 
| 77 | 
            +
             | 
| 78 | 
            +
            [root@localhost ansible]#
         | 
| 56 79 | 
             
            ```
         | 
| 57 80 |  | 
| 58 81 | 
             
            ###該当のソースコード
         | 
2
ansibleのエラーメッセージを見やすいように切り出し
    
        title	
    CHANGED
    
    | 
            File without changes
         | 
    
        body	
    CHANGED
    
    | @@ -7,6 +7,19 @@ | |
| 7 7 | 
             
            ###発生している問題・エラーメッセージ
         | 
| 8 8 |  | 
| 9 9 | 
             
            ```
         | 
| 10 | 
            +
            the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'unicode object' has no attribute 'gid'
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            The error appears to have been in '/vagrant/ansible/roles/test/tasks/main.yml': line 7, column 3, but may
         | 
| 13 | 
            +
            be elsewhere in the file depending on the exact syntax problem.
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            The offending line appears to be:
         | 
| 16 | 
            +
             | 
| 17 | 
            +
             | 
| 18 | 
            +
            - name: create groups debug
         | 
| 19 | 
            +
              ^ here
         | 
| 20 | 
            +
            ```
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            ```
         | 
| 10 23 | 
             
            [root@localhost ansible]# ansible-playbook test.yml --limit=vagrant --connection=local -v
         | 
| 11 24 | 
             
            Using /vagrant/ansible/ansible.cfg as config file
         | 
| 12 25 |  | 
1
タイトル誤字
    
        title	
    CHANGED
    
    | @@ -1,1 +1,1 @@ | |
| 1 | 
            -
            ansible環境変数参照時に
         | 
| 1 | 
            +
            ansible環境変数参照時にエラー
         | 
    
        body	
    CHANGED
    
    | 
            File without changes
         | 
