Hi Guys all of our windows hosts, has the following naming convention: 3 characters for the product - Letter for location - class of service (3 characters) - node number (2 digits) e.g pos-a-www-02 or ocs-b-sql-01 therefore my regex would look something like /^pos-(a|b)-www-\d\d$/ or /^ocs-(a|b)-sql-\d\d$/ how do I make these regex case insensitive as or hosts can be named pos-a-www-02 or POS-A-WWW-02 regards Jim -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Or does Puppet put everything into lowercase, as just checked my windows host and its name is in uppercase but when I look at inventory for this host the hostname is in lower case ??? regards jim On Friday, 22 February 2013 14:43:17 UTC, jim wrote:> > Hi Guys > > all of our windows hosts, has the following naming convention: > > 3 characters for the product - Letter for location - class of service (3 > characters) - node number (2 digits) > e.g > > pos-a-www-02 > or > ocs-b-sql-01 > > therefore my regex would look something like > > /^pos-(a|b)-www-\d\d$/ > or > /^ocs-(a|b)-sql-\d\d$/ > > how do I make these regex case insensitive > > as or hosts can be named > > pos-a-www-02 > or > POS-A-WWW-02 > > regards > > Jim >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
sorry the clientcert is lowercase the hostname is still upper case so my question on case insensitive is still valid regards jim On Friday, 22 February 2013 14:45:03 UTC, jim wrote:> > Or does Puppet put everything into lowercase, as just checked my windows > host and its name is in uppercase but when I look at inventory for this > host the hostname is in lower case ??? > > regards > > > jim > > On Friday, 22 February 2013 14:43:17 UTC, jim wrote: >> >> Hi Guys >> >> all of our windows hosts, has the following naming convention: >> >> 3 characters for the product - Letter for location - class of service (3 >> characters) - node number (2 digits) >> e.g >> >> pos-a-www-02 >> or >> ocs-b-sql-01 >> >> therefore my regex would look something like >> >> /^pos-(a|b)-www-\d\d$/ >> or >> /^ocs-(a|b)-sql-\d\d$/ >> >> how do I make these regex case insensitive >> >> as or hosts can be named >> >> pos-a-www-02 >> or >> POS-A-WWW-02 >> >> regards >> >> Jim >> >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Yes, puppet will downcase the fqdn and make this the default certname. Which is why I swore never to uppercase any host names again, it''s confusing. The $fqdn or $hostname are not used for selecting the node { } definition as far as I know. The $certname is what matters (or should be, anything else would be bad security). Anyway, have you tried /regex/i ? :-) HTH, Felix On 02/22/2013 03:45 PM, jim wrote:> sorry the clientcert is lowercase the hostname is still upper case so my > question on case insensitive is still valid > > regards > > jim-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
/option notation doesn''t work in puppet. However, (?option:...) notation does work. http://docs.puppetlabs.com/puppet/3/reference/lang_datatypes.html#regex-options So use /(?i:^pos-(a|b)-www-\d\d$)/ and see if that does what you want. On Friday, February 22, 2013 6:51:48 AM UTC-8, Felix.Frank wrote:> > Yes, puppet will downcase the fqdn and make this the default certname. > Which is why I swore never to uppercase any host names again, it''s > confusing. > > The $fqdn or $hostname are not used for selecting the node { } > definition as far as I know. The $certname is what matters (or should > be, anything else would be bad security). > > Anyway, have you tried /regex/i ? :-) > > HTH, > Felix > > On 02/22/2013 03:45 PM, jim wrote: > > sorry the clientcert is lowercase the hostname is still upper case so my > > question on case insensitive is still valid > > > > regards > > > > jim >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.