# Specify run list in unattended bootstrap?

**URL:** <https://discourse.chef.io/t/specify-run-list-in-unattended-bootstrap/7789>\
**Category:** Chef Infra (archive)\
**Created:** [February 11, 2016, 7:39pm UTC](https://discourse.chef.io/t/specify-run-list-in-unattended-bootstrap/7789 "2016-02-11T19:39:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nogginboink](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/nogginboink/32/1274_2.png) [@nogginboink](https://discourse.chef.io/u/nogginboink)\
**Post date:** [February 11, 2016, 7:39pm UTC](https://discourse.chef.io/t/specify-run-list-in-unattended-bootstrap/7789/1 "2016-02-11T19:39:48Z")

</div>

Okay, so my PXE boot/kickstart installation of Ubuntu server with the chef client is working. The last thing that I need to happen to make me really happy is to be able to specify a run list in the unattended bootstrap. However, after much Googling and link-clicking, I haven’t found a solution to this problem.

My ideal scenario is that I plug a new server into the network, turn it on, and press F12 to get it to PXE boot, and an hour later it’s all configured for its production role. I don’t want to have to go into knife and use the command line every time I put a new server into production.

How can this be accomplished? (My server is a physical server, so many of the AWS solutions don’t appear to be appropriate for my scenario.)

---

<div class="post-metadata">

**Author:** ![ameir](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ameir](https://discourse.chef.io/u/ameir)\
**Post date:** [February 11, 2016, 7:45pm UTC](https://discourse.chef.io/t/specify-run-list-in-unattended-bootstrap/7789/2 "2016-02-11T19:45:36Z")

</div>

The easiest way I’ve found is to do `chef-client -r <recipe>` to specify  
the run list. You can alternatively use `-j` and provide a json file with  
the run list provided there.

Thanks,  
Ameir

---

<div class="post-metadata">

**Author:** ![nogginboink](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/nogginboink/32/1274_2.png) [@nogginboink](https://discourse.chef.io/u/nogginboink)\
**Post date:** [February 12, 2016, 3:14pm UTC](https://discourse.chef.io/t/specify-run-list-in-unattended-bootstrap/7789/3 "2016-02-12T15:14:11Z")

</div>

Thanks, Ameir. Building off your suggestion, I was able to get a client to install from bare metal and run a run list.

However, I can’t figure out a way for the client to modify its run list on the server, which is ultimately what I want.

I’m surprised that this is so difficult to do. I can’t imagine that I’m the only Chef user that wants a fully automated method to deploy client machines. Is every Chef user out there really running `knife` for every new node that is put into the environment? That seems counterproductive to me. Why force users to add a manual step to an otherwise automated process?

Surely there’s a solution to this problem, isn’t there? Am I the oddball for wanting new machines in my environment to automatically enroll in configuration management?

---

<div class="post-metadata">

**Author:** ![ameir](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ameir](https://discourse.chef.io/u/ameir)\
**Post date:** [February 12, 2016, 3:41pm UTC](https://discourse.chef.io/t/specify-run-list-in-unattended-bootstrap/7789/4 "2016-02-12T15:41:29Z")

</div>

Sure, not a problem. At my company, we use an internal fork of [https://github.com/ameir/chef-initstrap](https://github.com/ameir/chef-initstrap) that looks up AWS tags and creates the full `chef-client` command with the run list, environment, and other options specified. We do not touch the servers at all; they come and go without any human intervention.

Ultimately, you just need to figure out a process to get the right params passed to `chef-client`; if all of your servers are homogenous, then that’s easily just done within PXE as you’re doing it; otherwise, you need to figure out how to target specific sets of nodes differently.

Hope that helps!  
-Ameir

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [February 12, 2016, 4:14pm UTC](https://discourse.chef.io/t/specify-run-list-in-unattended-bootstrap/7789/5 "2016-02-12T16:14:21Z")

</div>

> [@nogginboink](#):
>
> However, I can't figure out a way for the client to modify its run list on the server, which is ultimately what I want.

After a successful client run, the chef-client will write the node data back to the server, including the run list. As long as you set up whatever scripting you need to pass the correct run list in via either the `-j JSON` or `--runlist RUNLIST` options, and your chef-client run succeeds, you should end up with the correct node data on the server eventually.
