[Server-devel] [XSCE] xsce and ansible

Miguel González migonzalvar at activitycentral.com
Tue Oct 22 11:51:42 EDT 2013


(Sorry for cross posting)


On Mon, Oct 21, 2013 at 3:59 PM, Tim Moody <tim at timmoody.com> wrote:

>   The weekly XSCE call (Thur 2PM) was lightly attended last week because
> many were on their way to SF.  But we did spend some time on the question
> of moving to ansible as an installation mechanism and the means and timing
> of doing so.  The consensus on the call was that we should make the move,
> but that it should be gradual rather than sudden enlightenment.
>
> It turns out that because the directory structures of xs-config (
> github.com/XSCE/xsce) and dxs (activitycentral/dxs ) are substantially
> different (everything in plugins.d in the former and in roles in the
> latter) there are no collisions in directory names, so dxs could just be
> copied into xs-config.  So the process discussed is simply to combine both
> repos into xsce and then obsolete directories in plugins.d as confidence
> builds that the ansible playbook for a given feature works.
>
>

It sounds doable. But not sure how the transition will be. This is one
possible work breakdown in 3 phases:


Phase 1. A per service approach

I imagine we can substitute for example `named yes` in file xs-setup [1]
for something like `ansible-playbook -i ansible_hosts named.yml
--connection=local`.

```
num_ifaces=`ls /sys/class/net | wc | gawk '{print $1}'`

if [[ $num_ifaces > 2 ]]; then

-    named yes

+   ansible-playbook -i ansible_hosts named.yml --connection=local
    squid yes

    gateway yes

    dhcpd yes

    xs-setup-network

    touch /.olpcxs-net-configured

fi
```
And the same for xs-setup.conf.


Phase 2. xs-setup delegates entire sections to a playbook

Instead of per service playbooks we'll have a playbook for every section:

- gathering facts about network including interactive questions
- installing core services
- installation of additional services
- wrapping up

For example, for core services:

```
- num_ifaces=`ls /sys/class/net | wc | gawk '{print $1}'`

- if [[ $num_ifaces > 2 ]]; then

-   ansible-playbook -i ansible_hosts named.yml --connection=local
-    squid yes

-    gateway yes

-    dhcpd yes

-    xs-setup-network

-    touch /.olpcxs-net-configured

- fi
+ ansible-playbook -i ansible_hosts core_services.yml --connection=local
```


Phase 3. xs-setup is just an ansible launcher

```
#!/bin/bash
# xs-setup
ansible-playbook -i ansible_hosts xs.yml --connection=local
<EOF>
```


The main problem I see is how to share consistently information between
xs-setup and ansible worlds.




>  For those on the call, does this summarize what was said?  For those not
> on the call, does this sound like a viable plan?
>
> Tim
>



-- 
Miguel González
Activity Central: http://www.activitycentral.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/server-devel/attachments/20131022/2dfc15a5/attachment.html>


More information about the Server-devel mailing list