<% if @host.facts['Productname'] == ''ProLiant DL360 G7" -%> < How can we
provide multiply strings like G7,G8,G9?
part / --size=1 --grow --fstype ext4 --ondisk=sda
part swap --size=8192 --ondisk=sda
part /var/lib/mysql --size=1 --grow --asprimary --ondisk=sdb
<% end -%>
···
From: "'Denis Müller' via Foreman users"
To: "Foreman users"
Sent: Monday, December 19, 2016 9:35:07 AM
Subject: [foreman-users] Custom Partition Table
Hi guys,
we would woulk like to do this:
<% if @host.facts[‘Productname’] == ‘’ ProLiant DL360 G7" -%> < How can we provide multiply strings like G7,G8,G9?
part / --size=1 --grow --fstype ext4 --ondisk=sda
part swap --size=8192 --ondisk=sda
part /var/lib/mysql --size=1 --grow --asprimary --ondisk=sdb
<% end -%>
<% if @host.facts['productname'] =~ /^ProLiant DL360 G(6|7|8)$/ -%>
part / --size=1 --grow --fstype ext4 --ondisk=sda
part swap --size=8192 --ondisk=sda
part /var/lib/mysql --size=1 --grow --asprimary --ondisk=sdb
<% end -%>
Thank you!!!
···
Am Montag, 19. Dezember 2016 16:46:09 UTC+1 schrieb Jason B. Nance:
>
> Give one of these methods a try:
>
>
> https://stackoverflow.com/questions/2113235/ruby-is-a-string-in-a-list-of-values
>
> ------------------------------
> *From: *"'Denis Müller' via Foreman users" >
> *To: *"Foreman users" <forema...@googlegroups.com >
> *Sent: *Monday, December 19, 2016 9:35:07 AM
> *Subject: *[foreman-users] Custom Partition Table
>
> Hi guys,
> we would woulk like to do this:
>
> <% if @host.facts['Productname'] == ''ProLiant DL360 G7" -%> < How can we
> provide multiply strings like G7,G8,G9?
> part / --size=1 --grow --fstype ext4 --ondisk=sda
> part swap --size=8192 --ondisk=sda
> part /var/lib/mysql --size=1 --grow --asprimary --ondisk=sdb
> <% end -%>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to foreman-user...@googlegroups.com .
> To post to this group, send email to forema...@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.
>
We edited template one more time because there are no facts in foreman if
you create new host, so we got it work this way, maybe it would help
somebody else:
<% if @host.model.to_s =~ /^ProLiant DL360 G(6|7|8|9)$/ -%>
···
Am Dienstag, 20. Dezember 2016 08:38:53 UTC+1 schrieb Denis Müller:
>
> Worked for me:
>
> <% if @host.facts['productname'] =~ /^ProLiant DL360 G(6|7|8)$/ -%>
> part / --size=1 --grow --fstype ext4 --ondisk=sda
> part swap --size=8192 --ondisk=sda
> part /var/lib/mysql --size=1 --grow --asprimary --ondisk=sdb
> <% end -%>
>
> Thank you!!!
>
> Am Montag, 19. Dezember 2016 16:46:09 UTC+1 schrieb Jason B. Nance:
>>
>> Give one of these methods a try:
>>
>>
>> https://stackoverflow.com/questions/2113235/ruby-is-a-string-in-a-list-of-values
>>
>> ------------------------------
>> *From: *"'Denis Müller' via Foreman users"
>> *To: *"Foreman users"
>> *Sent: *Monday, December 19, 2016 9:35:07 AM
>> *Subject: *[foreman-users] Custom Partition Table
>>
>> Hi guys,
>> we would woulk like to do this:
>>
>> <% if @host.facts['Productname'] == ''ProLiant DL360 G7" -%> < How can
>> we provide multiply strings like G7,G8,G9?
>> part / --size=1 --grow --fstype ext4 --ondisk=sda
>> part swap --size=8192 --ondisk=sda
>> part /var/lib/mysql --size=1 --grow --asprimary --ondisk=sdb
>> <% end -%>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Foreman users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to foreman-user...@googlegroups.com.
>> To post to this group, send email to forema...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/foreman-users.
>> For more options, visit https://groups.google.com/d/optout.
>>
>