Article View: pl.comp.os.linux
Article #895593Re: Puppet i split
From: xyz
Date: Mon, 01 Feb 2016 20:07
Date: Mon, 01 Feb 2016 20:07
31 lines
1945 bytes
1945 bytes
W dniu 2016-02-01 o 19:37, Stachu 'Dozzie' K. pisze:
> On 2016-02-01, xyz <xyz@interia.pl> wrote:
>> Witam,
>> mam coś takiego (manifest .pp):
>>
>> $wersja = '1.2.3.4-5'
>> $wersja_arry = split($wersja, '-')
>> $wersja_dash = $wersja_arry[0]
>> notice("Wersja dash: $wersja_dash")
>>
>> $wersja_dot = split($wersja_dash, '.')
>> $wersja_dot_1 = $wersja_dot[0]
>> $wersja_dot_2 = $wersja_dot[1]
>> $wersja_dot_3 = $wersja_dot[2]
>> $wersja_dot_4 = $wersja_dot[3]
>> notice("Wersja dot: $wersja_dot $wersja_dot_1 $wersja_dot_2
>> $wersja_dot_3 $wersja_dot_4")
>>
>> O ile pierwszy notice wyświetla prawidłowo o tyle w drugim mam tylko
>> "Wersja dot:", co robię nie tak?
> Jesteś pewien, że puppetowy split dostaje literal string jako opis
> separatora?
>
Dałem ciała...
Dzięki za podpowiedź, dla ciekawych rozwiązanie na stronie:
https://docs.puppetlabs.com/puppet/latest/reference/function.html
Pozdrawiam
--
--- xyz
Technical Details
Message-ID:
<n8oe0d$2a3$1@node1.news.atman.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mailReferences:
<n8o824$klq$1@node2.news.atman.pl> <slrnnav9qs.9q8.dozzie@jarowit.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail From: xyz <xyz@interia.pl> Newsgroups: pl.comp.os.linux Subject: Re: Puppet i split Date: Mon, 1 Feb 2016 21:07:45 +0100 Organization: xyz Lines: 31 Message-ID: <n8oe0d$2a3$1@node1.news.atman.pl> References: <n8o824$klq$1@node2.news.atman.pl> <slrnnav9qs.9q8.dozzie@jarowit.net> Reply-To: xyz@interia.pl NNTP-Posting-Host: staticline24617.toya.net.pl Mime-Version: 1.0 X-Trace: node1.news.atman.pl 1454357325 2371 85.89.180.44 (1 Feb 2016 20:08:45 GMT) X-Complaints-To: usenet@atman.pl NNTP-Posting-Date: Mon, 1 Feb 2016 20:08:45 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: <slrnnav9qs.9q8.dozzie@jarowit.net> X-Antivirus: avast! (VPS 160201-0, 2016-02-01), Outbound message X-Antivirus-Status: Clean Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit