Invalid byte sequence

39 views
Skip to first unread message

Fran Rodríguez

unread,
Jan 14, 2014, 5:06:00 PM1/14/14
to example42-pu...@googlegroups.com
Hi people,

Im trying to use the yum module on a class which uses a specific module depend of which OS will be.


class repo-basic {
 
if $::osfamily == 'Debian' {
    include apt
    apt
::repository { 'security.debian.org.deb':
      url        
=> 'http://security.debian.org/',
      distro    
=> "${lsbdistcodename}",
      repository
=> 'main contrib non-free'
   
}
    apt
::repository { 'updates.debian.org.deb':
      url        
=> 'http://ftp.de.debian.org/debian',
      distro    
=> "${lsbdistcodename}",
      repository
=> 'main contrib non-free'
   
}
    apt
::repository { "${lsbdistcodename}.ftp.de.debian.org.deb":
      url        
=> 'http://ftp.de.debian.org/debian',
      distro    
=> "${lsbdistcodename}",
      repository
=> 'main contrib non-free'
   
}
 
} else {
    include yum
::repo::puppetlabs
 
}
}

The problem which i got is this when i run agent:

Error 400 on SERVER: invalid byte sequence in US-ASCII at /etc/puppet/environments/production/modules/yum/manifests/init.pp:1 on node

Anybody know what it means?¿

Cheers

Jochen Schalanda

unread,
Jan 14, 2014, 5:14:10 PM1/14/14
to example42-pu...@googlegroups.com
Hi Fran,

The dash character in your class name "repo-basic" is invalid (although
the Puppet parser is/was lenient enough to allow it), see [1] for details.

You might also have "invisible" characters (like escape sequences) in
your manifest file which you could show with `cat -v /path/to/init.pp`.


[1]:
http://docs.puppetlabs.com/puppet/3/reference/lang_reserved.html#classes-and-types


Cheers,
Jochen


On 14.01.2014 23:06, Fran Rodríguez wrote:
> Hi people,
>
> Im trying to use the yum module on a class which uses a specific module
> depend of which OS will be.
>
>
> |
> classrepo-basic {
> if$::osfamily =='Debian'{
> include apt
> apt::repository {'security.debian.org.deb':
> url =>'http://security.debian.org/',
> distro =>"${lsbdistcodename}",
> repository =>'main contrib non-free'
> }
> apt::repository {'updates.debian.org.deb':
> url =>'http://ftp.de.debian.org/debian',
> distro =>"${lsbdistcodename}",
> repository =>'main contrib non-free'
> }
> apt::repository {"${lsbdistcodename}.ftp.de.debian.org.deb":
> url =>'http://ftp.de.debian.org/debian',
> distro =>"${lsbdistcodename}",
> repository =>'main contrib non-free'
> }
> }else{
> include yum::repo::puppetlabs
> }
> }
> |
>
> The problem which i got is this when i run agent:
>
> Error 400 on SERVER: invalid byte sequence in US-ASCII at
> /etc/puppet/environments/production/modules/yum/manifests/init.pp:1 on node
>
> Anybody know what it means?¿
>
> Cheers
>
> --
> You received this message because you are subscribed to the Google
> Groups "Example42 Puppet Modules" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to example42-puppet-m...@googlegroups.com.
> To post to this group, send email to
> example42-pu...@googlegroups.com.
> Visit this group at http://groups.google.com/group/example42-puppet-modules.
> For more options, visit https://groups.google.com/groups/opt_out.

Fran Rodríguez

unread,
Jan 14, 2014, 5:49:44 PM1/14/14
to example42-pu...@googlegroups.com
Hi Jochen,

One colleague suggests to me that delete the first lines of comments from the module, and it seems it works. Ive also found that puppet has a bug with this situation..


Anyway, thank you very much for the faster answer.
Cheers.
Reply all
Reply to author
Forward
0 new messages