On 03/03/2014 06:18 PM, Azul wrote:
> that's an approach,
> however that '-x list' is likely to grow really quickly as it will
> require every service list which I restart after an update.
>
>
>
> On 3 March 2014 16:09, Petros Moisiadis <[email protected]
> <mailto:[email protected]>> wrote:
>
>     On 03/03/2014 06:02 PM, Azul Inho wrote:
>     >
>     >
>     > In my role "common" I have:
>     >
>     > - name: yum install OS
>     > updates
>     >
>     >    shell: yum update
>     > -y
>     >
>     >
>     > and then in my "application" role I have:
>     >
>     > - name: install app1
>     >   yum: name=app1 state=present
>     >   notify:
>     >      - restart app1
>     >
>     >
>     > This app1 is built in house and deployed to a local yum repo managed
>     > by jenkins, so every time I run the "common" role it gets updated to
>     > the latest version. As a result when the 'application' role runs my
>     > 'app1' no longer needs to be updated so my restart app1 handler
>     never
>     > gets executed.
>     >
>     > Any ideas how to 'fix this' ?
>     > Today I am simply restarting app1 every time I run ansible on this
>     > host which is not ideal.
>     >
>     >
>     > --
>     > 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]
>     <mailto:ansible-project%[email protected]>.
>     > To post to this group, send email to
>     [email protected]
>     <mailto:[email protected]>.
>     > To view this discussion on the web visit
>     >
>     
> https://groups.google.com/d/msgid/ansible-project/47f7a6df-7d9c-423f-9d24-d72c20450084%40googlegroups.com.
>     > For more options, visit https://groups.google.com/groups/opt_out.
>
>     Exclude your app from 'yum update' like this: 'yum -x app1 -y update'
>
>     --
>     You received this message because you are subscribed to a topic in
>     the Google Groups "Ansible Project" group.
>     To unsubscribe from this topic, visit
>     https://groups.google.com/d/topic/ansible-project/sY63qib6f9c/unsubscribe.
>     To unsubscribe from this group and all its topics, send an email
>     to [email protected]
>     <mailto:ansible-project%[email protected]>.
>     To post to this group, send email to
>     [email protected]
>     <mailto:[email protected]>.
>     To view this discussion on the web visit
>     
> https://groups.google.com/d/msgid/ansible-project/5314A939.8090709%40yahoo.gr.
>     For more options, visit https://groups.google.com/groups/opt_out.
>
>
> -- 
> 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/CAMP%3DowhVtO6mWT%3DUL5Lw2JAEWqZ5F3e1dgbtHw3wnCu9z9sDpQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

You can always define and maintain a list variable with the excluded
packages.

Then, you may make your task look like this:

- name: yum install OS updates
  shell: yum -x {{ excluded_packages|join('-x ') }} -y update


Or create /etc/yum.conf from a template with an equivalent 'exclude={{
excluded_packages|join(' ') }}' line in its [main] section.

-- 
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/5314B0F2.40905%40yahoo.gr.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to