- From: "Van Fossan,Randy" <
>
- To: <
>
- Subject: [chef] RE: Re: Help - Creating a "First Run Only" Resource
- Date: Mon, 7 Nov 2011 13:53:43 -0500
Hi Adam,
No, I really need the First Run Only so that if a disk fails and is
replaced, it doesn't automatically fdisk it. I need the First Run Only
Resource. Also, there is quite a bit more code to go in the snippet as
well.
-----Original Message-----
From: Adam Jacob
[mailto:
Sent: Monday, November 07, 2011 12:57 PM
To:
Subject: [chef] Re: Help - Creating a "First Run Only" Resource
You want to figure out what command you can run to verify the partition
table is set correctly, and add it as a not_if to the resource.
Adam
---
Opscode, Inc.
Adam Jacob, Chief Product Officer
T: (206) 619-7151 E:
On Nov 7, 2011, at 9:47 AM, Van Fossan,Randy wrote:
>
I am still learning to write cookbooks and need to Create a "First Run
Only" Resource. I am looking at the Wiki Creating a "First Run Only"
Resource
>
(http://wiki.opscode.com/pages/viewpage.action?pageId=15728818) and am
having some difficulties interpreting the example. Does anyone have a
cookbook with a complete example?
>
>
Basically, I have a recipe (config_disk.rb) that needs to do the
following only once.
>
>
------Begin snippet ---
>
bash "Configure_Disk" do
>
user "root"
>
cwd "/tmp"
>
code <<-EOH
>
#### Partition sda (Name and Data node) /sbin/fdisk /dev/sda << EOF n
>
p
>
>
>
w
>
EOF
>
/sbin/partprobe /dev/sda
>
#######Partition sdb (Name and Data node)
>
/sbin/fdisk /dev/sdb << EOF
>
n
>
p
>
1
>
>
>
w
>
EOF
>
EOH
>
end
>
----End of snippet-----
>
>
Thanks
>
Randy
>
OCLC Inc.
Archive powered by MHonArc 2.6.16.