<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="All recent releases"><pre class="notranslate"><code class="notranslate">All recent releases
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Ubuntu 16.04 4.4.0-24</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">An error prevents from building the debian package from git sources.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">release_number=$(your call)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    build_date=$(date --rfc-2822)
    echo --------
    echo Cleaning
    echo --------
    cd git-ansible
    git reset --hard
    git clean -fxd :/
    git fetch --progress --prune origin
    git checkout v${release_number}

    echo -------------------------------------------------------
    echo &quot;Copying Debian control folder in the expected location&quot;
    echo -------------------------------------------------------
    rsync -av --delete packaging/debian .

    echo --------------------------------------------------------------------------
    echo &quot;Modifying debian/changelog with current release &amp; date&quot;
    echo ---------------------------------------------------------------------------
    sed -i 1,6d debian/changelog
    sed -i &quot;1s/^/ansible (${release_number}) unstable; urgency=low\n\n  * ${release_number}\n\n -- Jean-Christophe Manciot &lt;manciot.jeanchristophe@gmail.com&gt;  $build_date\n\n/&quot; debian/changelog

    echo --------
    echo Building
    echo --------
    dpkg-buildpackage -b -m&quot;Jean-Christophe Manciot &lt;manciot.jeanchristophe@gmail.com&gt;&quot;"><pre class="notranslate"><code class="notranslate">    build_date=$(date --rfc-2822)
    echo --------
    echo Cleaning
    echo --------
    cd git-ansible
    git reset --hard
    git clean -fxd :/
    git fetch --progress --prune origin
    git checkout v${release_number}

    echo -------------------------------------------------------
    echo "Copying Debian control folder in the expected location"
    echo -------------------------------------------------------
    rsync -av --delete packaging/debian .

    echo --------------------------------------------------------------------------
    echo "Modifying debian/changelog with current release &amp; date"
    echo ---------------------------------------------------------------------------
    sed -i 1,6d debian/changelog
    sed -i "1s/^/ansible (${release_number}) unstable; urgency=low\n\n  * ${release_number}\n\n -- Jean-Christophe Manciot &lt;manciot.jeanchristophe@gmail.com&gt;  $build_date\n\n/" debian/changelog

    echo --------
    echo Building
    echo --------
    dpkg-buildpackage -b -m"Jean-Christophe Manciot &lt;manciot.jeanchristophe@gmail.com&gt;"
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="...
dh_install -pansible  
dh_install: Cannot find (any matches for) &quot;docs/man/man1/*.1&quot; (tried in &quot;.&quot;)
dh_install: ansible missing files: docs/man/man1/*.1
dh_install: missing files, aborting
/usr/share/cdbs/1/rules/debhelper.mk:213: recipe for target 'binary-install/ansible' failed
make: *** [binary-install/ansible] Error 255
dpkg-buildpackage: error: debian/rules binary gave error exit status 2"><pre class="notranslate"><code class="notranslate">...
dh_install -pansible  
dh_install: Cannot find (any matches for) "docs/man/man1/*.1" (tried in ".")
dh_install: ansible missing files: docs/man/man1/*.1
dh_install: missing files, aborting
/usr/share/cdbs/1/rules/debhelper.mk:213: recipe for target 'binary-install/ansible' failed
make: *** [binary-install/ansible] Error 255
dpkg-buildpackage: error: debian/rules binary gave error exit status 2
</code></pre></div>
<p dir="auto">Full log with <strong>2.1.1.0-0.1.rc1</strong>:<br>
<a href="https://github.com/ansible/ansible/files/321678/Cannot.find.any.matches.for.docs-man-man1-.1.txt">Cannot find any matches for docs-man-man1-*.1.txt</a></p>
<p dir="auto">ansible_sudo=True/False<br>
in inventory.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[krb5]
localhost
s8webera ansible_ssh_user=root ansible_sudo=False ansible_python_interpreter=/usr/bin/python2.7"><pre class="notranslate"><code class="notranslate">[krb5]
localhost
s8webera ansible_ssh_user=root ansible_sudo=False ansible_python_interpreter=/usr/bin/python2.7
</code></pre></div>
<p dir="auto">This is important on mixed environment where some system dont have sudo installed.</p>
<p dir="auto">Here is a current working solution that im using in production.<br>
This was programmed as a hack.. So please could a project maintainer develop this fix correctly.</p>
<p dir="auto">file:///home/s8weber/srv/ansible/lib/ansible/runner/<strong>init</strong>.py</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    def _executor_internal(self, host):
        ''' executes any module one or more times '''

        host_variables = self.inventory.get_variables(host)

        if host_variables.get('ansible_sudo', None):
          self.sudo = host_variables.get('ansible_sudo', None) == 'True' 

     ...."><pre class="notranslate"><code class="notranslate">    def _executor_internal(self, host):
        ''' executes any module one or more times '''

        host_variables = self.inventory.get_variables(host)

        if host_variables.get('ansible_sudo', None):
          self.sudo = host_variables.get('ansible_sudo', None) == 'True' 

     ....
</code></pre></div>