Ask Your Question
0

Puppet: vcsrepo with git , different request format between Ubuntu and CentOS

asked 2017-02-14 01:59:54 -0600

raja gravatar image

This is the code I have in my puppetmaster

class mediawiki {

        $phpmysql = $osfamily ? {
        'redhat' => 'php-mysql',
        'debian' => 'php5-mysql',
        default => 'php-mysql',
        }

        package { $phpmysql:
                ensure => 'present',
        }

        if $osfamily == 'redhat' {

        package {'php-xml':
                ensure => 'present',
        }
}

        class { '::apache':
                docroot => '/var/www/html',
                mpm_module => 'prefork',
                subscribe => Package[$phpmysql],
                }

        class { '::apache::mod::php': }

        vcsrepo {'/var/www/html':
                ensure => 'present',
                provider => 'git',
                source => "https://github.com/wikimedia/mediawiki.git",
                revision => 'REL1_23',
                }

And when I execute puppet agent with debug enabled as below

puppet agent --debug --verbose --no-daemonize --onetime

I could see that CentOS and Ubuntu puppet agents are sending request to Git in different ways and for Ubuntu I am able to pull the code from Git but for CentOS its failing with wrong revision number as below

Error: /Stage[main]/Mediawiki/Vcsrepo[/var/www/html]: Could not evaluate: Execution of '/usr/bin/git rev-parse HEAD' returned 128: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
HEAD

CentOS Debug Log

Debug: /Stage[main]/Linux/File[/info.txt]: The container Class[Linux] will propagate my refresh event
Debug: /Stage[main]/Mediawiki/File[/var/www/html/index.html]: Nothing to manage: no ensure and the resource doesn't exist
Debug: Executing '/usr/bin/git config --get remote.origin.url'
Debug: Executing '/usr/bin/git remote'
Debug: Executing '/usr/bin/git config --get remote.origin.url'
Debug: Executing '/usr/bin/git fetch origin'
Debug: Executing '/usr/bin/git fetch --tags origin'
Debug: Executing '/usr/bin/git rev-parse HEAD'
Error: /Stage[main]/Mediawiki/Vcsrepo[/var/www/html]: Could not evaluate: Execution of '/usr/bin/git rev-parse HEAD' returned 128: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
HEAD

Ubuntu Debug Log

Debug: /Stage[main]/Mediawiki/File[/var/www/html/index.html]: Nothing to manage: no ensure and the resource doesn't exist
Debug: Executing '/usr/bin/git config --get remote.origin.url'
Debug: Executing '/usr/bin/git remote'
Debug: Executing '/usr/bin/git config --get remote.origin.url'
Debug: Executing '/usr/bin/git fetch origin'
Debug: Executing '/usr/bin/git fetch --tags origin'
Debug: Executing '/usr/bin/git rev-parse HEAD'
Debug: Executing '/usr/bin/git tag -l'
Debug: Executing '/usr/bin/git branch -a'
Debug: Executing '/usr/bin/git rev-parse REL1_23'

Dont know why CentOS looking it differently.

Thank you.

edit retag flag offensive close merge delete

Comments

Try filing an issue in the puppetlabs jira MODULES section https://tickets.puppetlabs.com/browse/MODULES/

DarylW gravatar imageDarylW ( 2017-02-14 07:48:13 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-02-14 08:44:48 -0600

raja gravatar image

updated 2017-02-14 08:45:22 -0600

My internet connection broken while trying for my first checkout with git into /var/www/html directory and from 2nd attempt onward I have received that error.

I have removed complete /var/www/html with

rm -rf /var/www/html

and issued

puppet agent --verbose --no-daemonize --onetime

and its worked fine.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-14 01:59:54 -0600

Seen: 67 times

Last updated: Feb 14