<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Trikke76/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Trikke76">@Trikke76</a> on 2016-11-21T08:41:18Z</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<ul dir="auto">
<li>monitoring/zabbix_maintenance.py</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.1.0"><pre class="notranslate"><code class="notranslate">ansible 2.1.1.0
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

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

<h5 dir="auto">SUMMARY</h5>
<p dir="auto">The module creates or deletes a maintenance periode in zabbix. But it would be nice if the role would also give the option to update a role.<br>
sometimes you want to deploy a system with a role name that is the same as another system that was deployed</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="190651077" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-extras/issues/3502" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-extras/issues/3502/hovercard" href="https://github.com/ansible/ansible-modules-extras/issues/3502">ansible/ansible-modules-extras#3502</a></p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">zabbix_maintenance</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.2.0"><pre class="notranslate"><code class="notranslate">ansible 2.2.2.0
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

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

<h5 dir="auto">SUMMARY</h5>

<h5 dir="auto">STEPS TO REPRODUCE</h5>

<p dir="auto">The module correctly creates and removes maintenance periods, however it cannot be used to update a maintenance period. The status is shown as OK instead of changed and no changes to the maintenance period occur.</p>

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    - name: Start maintenance window
      delegate_to: localhost
      zabbix_maintenance:
        name: test-window
        server_url: http://example.org
        login_user: &quot;{{username}}&quot;
        login_password: &quot;{{password}}&quot;
        host_name: &quot;{{inventory_hostname}}&quot;
        state: present
        minutes: 15
        collect_data: false
        
    - name: Update maintenance window
      delegate_to: localhost
      zabbix_maintenance:
        name: test-window
        server_url: http://example.org
        login_user: &quot;{{username}}&quot;
        login_password: &quot;{{password}}&quot;
        host_name: &quot;{{inventory_hostname}}&quot;
        state: present
        minutes: 5
        collect_data: false"><pre class="notranslate">    - <span class="pl-ent">name</span>: <span class="pl-s">Start maintenance window</span>
      <span class="pl-ent">delegate_to</span>: <span class="pl-s">localhost</span>
      <span class="pl-ent">zabbix_maintenance</span>:
        <span class="pl-ent">name</span>: <span class="pl-s">test-window</span>
        <span class="pl-ent">server_url</span>: <span class="pl-s">http://example.org</span>
        <span class="pl-ent">login_user</span>: <span class="pl-s"><span class="pl-pds">"</span>{{username}}<span class="pl-pds">"</span></span>
        <span class="pl-ent">login_password</span>: <span class="pl-s"><span class="pl-pds">"</span>{{password}}<span class="pl-pds">"</span></span>
        <span class="pl-ent">host_name</span>: <span class="pl-s"><span class="pl-pds">"</span>{{inventory_hostname}}<span class="pl-pds">"</span></span>
        <span class="pl-ent">state</span>: <span class="pl-s">present</span>
        <span class="pl-ent">minutes</span>: <span class="pl-c1">15</span>
        <span class="pl-ent">collect_data</span>: <span class="pl-c1">false</span>
        
    - <span class="pl-ent">name</span>: <span class="pl-s">Update maintenance window</span>
      <span class="pl-ent">delegate_to</span>: <span class="pl-s">localhost</span>
      <span class="pl-ent">zabbix_maintenance</span>:
        <span class="pl-ent">name</span>: <span class="pl-s">test-window</span>
        <span class="pl-ent">server_url</span>: <span class="pl-s">http://example.org</span>
        <span class="pl-ent">login_user</span>: <span class="pl-s"><span class="pl-pds">"</span>{{username}}<span class="pl-pds">"</span></span>
        <span class="pl-ent">login_password</span>: <span class="pl-s"><span class="pl-pds">"</span>{{password}}<span class="pl-pds">"</span></span>
        <span class="pl-ent">host_name</span>: <span class="pl-s"><span class="pl-pds">"</span>{{inventory_hostname}}<span class="pl-pds">"</span></span>
        <span class="pl-ent">state</span>: <span class="pl-s">present</span>
        <span class="pl-ent">minutes</span>: <span class="pl-c1">5</span>
        <span class="pl-ent">collect_data</span>: <span class="pl-c1">false</span></pre></div>

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

<p dir="auto">I expect the first step to create the maintenance window for 15 minutes. I then expect the second step to reduce this maintenance window to 5 minutes.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>

<p dir="auto">The maintenance window is set to 15 minutes in the first step, then the second step does nothing.</p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [Start maintenance window] ************************************************
changed: [test-host -&gt; localhost]

TASK [Adjust maintenance window] ***********************************************
ok: [test-host -&gt; localhost]"><pre class="notranslate"><code class="notranslate">TASK [Start maintenance window] ************************************************
changed: [test-host -&gt; localhost]

TASK [Adjust maintenance window] ***********************************************
ok: [test-host -&gt; localhost]
</code></pre></div>