<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">oc</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.4.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/luka/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.13 (default, Jul 21 2017, 03:24:34) [GCC 7.1.1 20170630]
"><pre class="notranslate"><code class="notranslate">ansible 2.4.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/luka/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.13 (default, Jul 21 2017, 03:24:34) [GCC 7.1.1 20170630]

</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">default</p>

<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">Linux / Manjaro</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">oc module with inline definition expands list of triggers.<br>
i.e. when set to empty list, it maintains old configuration, while having some triggers adds duplicate entry on each run.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: Create OpenShift resource
  oc:
    host: &quot;{{ inventory_hostname }}&quot;
    validate_certs: false
    state: present
    inline: &quot;{{ lookup('template', openshift_template) | from_yaml }}&quot;
    token: &quot;{{ namespace_token }}&quot;"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">Create OpenShift resource</span>
  <span class="pl-ent">oc</span>:
    <span class="pl-ent">host</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ inventory_hostname }}<span class="pl-pds">"</span></span>
    <span class="pl-ent">validate_certs</span>: <span class="pl-c1">false</span>
    <span class="pl-ent">state</span>: <span class="pl-s">present</span>
    <span class="pl-ent">inline</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ lookup('template', openshift_template) | from_yaml }}<span class="pl-pds">"</span></span>
    <span class="pl-ent">token</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ namespace_token }}<span class="pl-pds">"</span></span></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">replaced list</p>
<h5 dir="auto">ACTUAL RESULTS</h5>

<p dir="auto">extended list with duplicates / persisting old config</p>
<p dir="auto">I'm using the ssh config as a single location for holding all the confi<br>
associated with connecting to a remote node, with the inventory<br>
file just referencing the names of ssh host aliases, and use  ANSIBLE_TRANSPORT=ssh always.<br>
It works great for most things (keys, IPs, jump hosts), but if a remote host<br>
uses a non-standard port, ansible ignores the port specified in the ssh<br>
config and tries to connect on port 22, which fails.</p>