<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>If I modify kolla_docker.py , how to debug an ansible module ?  <br>
    </p>
    <p>I find
      <a class="moz-txt-link-freetext" href="http://docs.ansible.com/ansible/dev_guide/developing_modules.html">http://docs.ansible.com/ansible/dev_guide/developing_modules.html</a>,
      but  failed to run it as following.<br>
    </p>
    how do you do testing when  develop the module ? <br>
    <br>
    [root@server120 ansible-module]# ansible/hacking/test-module  -m
    ./kolla_docker.py <br>
    * including generated source, if any, saving to:
    /root/.ansible_module_generated<br>
    * ansiballz module detected; extracted module source to:
    /root/debug_dir<br>
    ***********************************<br>
    RAW OUTPUT<br>
    <br>
    {"msg": "missing required arguments: action", "failed": true,
    "invocation": {"module_args": {"cap_add": [], "graceful_timeout":
    10, "common_options": {}, "labels": {}, "remove_on_exit": true,
    "tls_verify": false, "restart_retries": 10, "detach": true,
    "security_opt": [], "privileged": false, "api_version": "auto"}}}<br>
    <br>
    <br>
    ***********************************<br>
    PARSED OUTPUT<br>
    {<br>
        "failed": true, <br>
        "invocation": {<br>
            "module_args": {<br>
                "api_version": "auto", <br>
                "cap_add": [], <br>
                "common_options": {}, <br>
                "detach": true, <br>
                "graceful_timeout": 10, <br>
                "labels": {}, <br>
                "privileged": false, <br>
                "remove_on_exit": true, <br>
                "restart_retries": 10, <br>
                "security_opt": [], <br>
                "tls_verify": false<br>
            }<br>
        }, <br>
        "msg": "missing required arguments: action"<br>
    }<br>
    <br>
    <div class="moz-cite-prefix">On 7/11 17:50, Margin Hu wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:2fc1bd12-a6e4-8491-8dc1-0b46275506bc@163.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p>Ok, I see. <br>
      </p>
      <p>I wanted to add "--ulimit " parameter when docker run ,  It
        seems that I have to add an extra parameter for kolla_docker
        module in kolla_docker.py. <br>
      </p>
      <br>
      <div class="moz-cite-prefix">On 7/11 17:08, Jeffrey Zhang wrote:<br>
      </div>
      <blockquote type="cite"
cite="mid:CAATxhGc8TsuN4oTSrmDzQEJghYkyWB1P4c=qCRHfavvuL5Otjg@mail.gmail.com">
        <div dir="ltr">
          <div class="gmail_default"
            style="font-family:monospace,monospace;font-size:small">there
            are lots of non-plain variables in kolla, dict or list in
            Ansible. </div>
          <div class="gmail_default"
            style="font-family:monospace,monospace;font-size:small"><br>
          </div>
          <div class="gmail_default"
            style="font-family:monospace,monospace;font-size:small">if
            you do not want to override the dict, you can add following
            into globals.yml file.</div>
          <div class="gmail_default"
            style="font-family:monospace,monospace;font-size:small"><br>
          </div>
          <div class="gmail_default"
            style="font-family:monospace,monospace;font-size:small">
            <div class="gmail_default">docker_common_options:</div>
            <div class="gmail_default">    auth_email: "{{
              docker_registry_email }}"</div>
            <div class="gmail_default">    auth_password: "{{
              docker_registry_password }}"</div>
            <div class="gmail_default">    auth_registry: "{{
              docker_registry }}"</div>
            <div class="gmail_default">    auth_username: "{{
              docker_registry_username }}"</div>
            <div class="gmail_default">    environment:</div>
            <div class="gmail_default">      KOLLA_CONFIG_STRATEGY: "{{
              config_strategy }}"</div>
            <div class="gmail_default">      custom_key: custom value</div>
            <div class="gmail_default">    restart_policy: "{{
              docker_restart_policy }}"</div>
            <div class="gmail_default">    restart_retries: "{{
              docker_restart_policy_retry }}"</div>
            <div><br>
            </div>
          </div>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Tue, Jul 11, 2017 at 4:55 PM, Paul
            Bourke <span dir="ltr"><<a
                href="mailto:paul.bourke@oracle.com" target="_blank"
                moz-do-not-send="true">paul.bourke@oracle.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">Because
              its a series of key value pairs: <a
href="https://github.com/openstack/kolla-ansible/blob/master/ansible/group_vars/all.yml#L96-L105"
                rel="noreferrer" target="_blank" moz-do-not-send="true">https://github.com/openstack/k<wbr>olla-ansible/blob/master/ansib<wbr>le/group_vars/all.yml#L96-L105</a><br>
              <br>
              Is there another type you feel would fit better?
              <div class="HOEnZb">
                <div class="h5"><br>
                  <br>
                  On 11/07/17 05:22, Margin Hu wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    Hi Guys:<br>
                    <br>
                    I want to set docker_common_options parameter but
                    find its type is dictionary.  why?<br>
                    <br>
                    ansible/roles/zun/tasks/pull.y<wbr>ml:5:   
                    common_options: "{{ docker_common_options }}"<br>
                    tests/test_kolla_docker.py:44:
                    common_options=dict(required=F<wbr>alse,
                    type='dict', default=dict()),<br>
                    <br>
                    <br>
                    <br>
                    <br>
                    ______________________________<wbr>______________________________<wbr>______________<br>
                    OpenStack Development Mailing List (not for usage
                    questions)<br>
                    Unsubscribe: <a
href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true">OpenStack-dev-request@lists.op<wbr>enstack.org?subject:unsubscrib<wbr>e</a><br>
                    <a
                      href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
                  </blockquote>
                  <br>
                  ______________________________<wbr>______________________________<wbr>______________<br>
                  OpenStack Development Mailing List (not for usage
                  questions)<br>
                  Unsubscribe: <a
href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">OpenStack-dev-request@lists.op<wbr>enstack.org?subject:unsubscrib<wbr>e</a><br>
                  <a
                    href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div><span
                              style="font-size:13px;border-collapse:collapse"><font
                                face="monospace, monospace">Regards,</font></span></div>
                          <div><span
                              style="font-size:13px;border-collapse:collapse"><font
                                face="monospace, monospace">Jeffrey
                                Zhang</font></span></div>
                          <div><span
                              style="font-family:monospace,monospace;font-size:12.8px">Blog: </span><a
                              href="http://xcodest.me/"
                              style="font-family:monospace,monospace;font-size:12.8px"
                              target="_blank" moz-do-not-send="true">http://xcodest.me</a><font
                              face="monospace, monospace"><br>
                            </font></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" moz-do-not-send="true">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" moz-do-not-send="true">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>