1 |
On 01/27/2015 10:34 AM, James wrote: |
2 |
> Alec Ten Harmsel <alec <at> alectenharmsel.com> writes: |
3 |
> |
4 |
> |
5 |
> |
6 |
>> I'm sorry to spam gentoo-user, but I'm not sure who else would be |
7 |
>> interested in something like this. Also, feel free to email me with bugs |
8 |
>> in the code or documentation, or open something in GitHub's issue tracker. |
9 |
> One man's spam generates maps for another..... |
10 |
> |
11 |
> |
12 |
> So my map of "todo" on ansible is all about common gentoo installs. [1] |
13 |
> Let's take the first and most easy example "the clone". I have a gentoo |
14 |
> workstation install that I want to replicated onto identical hardware (sort |
15 |
> of like a disk to disk "dd" install). |
16 |
> |
17 |
> So how would I impress the bossman by actually saving admin time |
18 |
> on how to use the bossman to create (install from scratch + pxe?) |
19 |
> a clone. |
20 |
|
21 |
Assuming that disks are formatted, a stage3 has been freshly extracted, |
22 |
bossman is installed, and the role/config files are on a mounted |
23 |
filesystem, it should be similar to the role below: |
24 |
|
25 |
file /etc/portage/make.conf root:root 644 |
26 |
! emerge-webrsync |
27 |
! emerge --sync |
28 |
|
29 |
file /etc/locale.gen root:root 600 |
30 |
! locale-gen |
31 |
|
32 |
pkg sys-kernel/gentoo-sources |
33 |
file /usr/src/linux/.config root:root 644 |
34 |
! make -C /usr/src/linux all modules_install install |
35 |
|
36 |
pkg sys-boot/grub |
37 |
! grub-install /dev/sda # I can't remember all the options needed here |
38 |
file /etc/default/grub |
39 |
! grub-mkconfig -o /boot/grub/grub.cfg |
40 |
|
41 |
# Generating /etc/fstab using something similar to Arch's `genfstab` |
42 |
would be much better |
43 |
file /etc/fstab root:root 644 |
44 |
|
45 |
# Root password |
46 |
file /etc/shadow root:root 640 |
47 |
|
48 |
# Logger |
49 |
pkg app-admin/syslog-ng |
50 |
|
51 |
# Network |
52 |
pkg net-misc/dhcpcd |
53 |
enable dhcpcd |
54 |
|
55 |
# For remote access |
56 |
pkg net-misc/openssh |
57 |
file /etc/ssh/sshd_config root:root 600 |
58 |
file /etc/ssh/known_hosts root:root 600 |
59 |
# Other sshd files... |
60 |
enable sshd |
61 |
|
62 |
There are a ton of assumptions that make this work; if installing |
63 |
manually, the installer is responsible, and if installing from PXE, this |
64 |
stuff would have to be baked into the ISO. |
65 |
|
66 |
> |
67 |
> |
68 |
> Gotta recipe for that using bossman? |
69 |
> Or is that an invalid direction for bossman? |
70 |
> |
71 |
> curiously, |
72 |
> James |
73 |
> |
74 |
> |
75 |
> [1] |
76 |
> http://blog.jameskyle.org/2014/08/automated-stage3-gentoo-install-using-ansible/ |
77 |
> |
78 |
> |
79 |
> |
80 |
> |
81 |
|
82 |
Automating the bootstrapping of a node is reasonably complicted, even |
83 |
harder on Gentoo than on RHEL. This is the type of thinking I want to |
84 |
do, and I'm working on doing this with my CentOS box that runs ssh, |
85 |
Jenkins, postgres, and Redmine. |
86 |
|
87 |
Alec |