I guess I'll answer my own question. This seems to be the most common
approach:
- name: build ffmpeg
command: chdir=/var/tmp/ffmpeg-0.11 {{ item }}
with_items:
- sudo ./configure --enable-libmp3lame
- sudo make
- sudo make install PATH=$PATH:/usr/local/bin
If you need env variables set for a specific step, you can add them on the
command line as I've done with the PATH above. The PATH is changed only for
the 'sudo' (e.g. root) environment.
J
On Wednesday, April 9, 2014 9:38:42 AM UTC-5, Slim Slam wrote:
>
> What's the Ansible best practice for doing a typical source compile of
> multiple packages?
>
> So, let's say you have three source packages that all require the same
> three steps: configure, make, and make install.
>
> The three packages have all have been untar-ed into their own directories:
>
> /var/tmp/pkg1
> /var/tmp/pkg2
> /var/tmp/pkg3
>
> What's the typical Ansible way to handle it?
>
> - name: build sources
>
>
> command: chdir=/var/tmp/{{ item }} sudo .configure --prefix=/usr
>
> command: chdir=/var/tmp/{{ item }} sudo make
>
> command: chdir=/var/tmp/{{ item }} sudo make install
>
>
> with_items:
>
> - pkg1
>
> - pkg2
>
> - pkg3
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5e70d78d-287b-44a1-96e3-1674f9e3f411%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.