Re: [ansible-project] Using a defined group_var over an undefined host_var (or how to hack variable precedence)

2018-12-18 Thread Branko Majic
;those" answers, but the way you are describing it looks to be a bit overcomplicated to me. E.g. even if it can be done, sounds like it would be rather fiddly and unintuitive when you decide to make configuration changes. Best regards -- Branko Majic XMPP: bra...@majic.rs Please use only Free fo

Re: [ansible-project] How to configure playbook serial value by group var from inventory file?

2018-02-09 Thread Branko Majic
ch size > hosts: deployservers > serial: "{{ batch_deploy }}" Here, the variable is called "batch_deploy". E.g. not the same as in the inventory file (swapped batch/deploy in the name). Best regards -- Branko Majic XMPP: bra...@majic.rs Please use only Free forma

Re: [ansible-project] Problem referencing variables

2017-09-21 Thread Branko Majic
: /home/"{{ new_user_acct_name }}"/.ssh/authorized_keys Any reason you wouldn't be using authorized_key module (http://docs.ansible.com/ansible/latest/authorized_key_module.html)? Best regards -- Branko Majic XMPP: bra...@majic.rs Please use only Free formats when sending attachment

Re: [ansible-project] ansible doubt

2017-07-28 Thread Branko Majic
ers. In your case, you should try running something similar to: ansible --ask-become-pass --become-method su -b -k -m shell -a "/sbin/vgs" all This will prompt you for two passwords - one for SSH connection, and one for the _root_ user. Best regards -- Branko Majic XMPP: bra...@majic

Re: [ansible-project] service module doesnt work

2017-07-22 Thread Branko Majic
nally, the task as you have output it here would never run because of syntax errors (even if you had it correctly included) - because it's not valid yaml. It would need to look something similar to (note the spaces and newlines): - name: "restart crond service" - service: name: crond

Re: [ansible-project] How to *not* print ansible diagnostic error messages?

2017-07-21 Thread Branko Majic
h, keep in mind that would make the task treated as successful for all other purposes (e.g. ES.failed would be set to False). Best regards -- Branko Majic XMPP: bra...@majic.rs Please use only Free formats when sending attachments to me. Бранко Мајић XMPP: bra...@majic.rs Молим вас да додатке шаље

Re: [ansible-project] Loop using with_items twice

2017-07-21 Thread Branko Majic
ber of all groups in the grouplist variable, your second task should be one of the following (Ansible 2.3 can accept lists directly in "groups" attribute): - name: Create users from vars users (Ansible 2.3+) user: name: "{{ item }}" state: present groups: "{{ gr

Re: [ansible-project] elb_target_group module no longer in use?

2017-07-20 Thread Branko Majic
cal copy of it available to your playbooks (which, of course, you need to remember to remove etc - after testing - once 2.4 comes out :) Best regards -- Branko Majic XMPP: bra...@majic.rs Please use only Free formats when sending attachments to me. Бранко Мајић XMPP: bra...@majic.rs Молим в

Re: [ansible-project] Ask about "side by side" loop

2017-07-20 Thread Branko Majic
fferent iteration?...Thank you Did you consider using a bit of arithmetic instead? Or this is not flexible enough for you? E.g. you could do "{{ 100 + item | int }}" (take note you need the "| int" on item because it's a string). Preferably you'd make the "100" a param

Re: [ansible-project] How to detect which role called an other role in case of role dependency

2017-04-18 Thread Branko Majic
cases where you want to control ordering in more complex way than just the "meta deps first" -> "then this role". Finally, you had two replies related to avoid dependencies via meta, something you should consider as well (I thought it'd be nice to provide at least one more wa

Re: [ansible-project] Tags as variable inside of playbook

2016-03-15 Thread Branko Majic
gt; If I understand correctly what you want... > > ansible-playbook myplaybook.yml --tags=myspecialtag is what you're > looking for... > > A tag can be use in more than one task... > > The doc : > http://docs.ansible.com/ansible/playbooks_tags.html > > > Regards,

[ansible-project] Tags as variable inside of playbook

2016-03-15 Thread Branko Majic
could abuse the tags system a bit to make the syntax less verbose/clearer. Best regards -- Branko Majic Jabber: bra...@majic.rs Please use only Free formats when sending attachments to me. Бранко Мајић Џабер: bra...@majic.rs Молим вас да додатке шаљете искључиво у слободним форматима. -- You

Re: [ansible-project] Re: Dealing with inconsistencies after failed runs

2016-03-15 Thread Branko Majic
could rerun those tasks to fix things up. Any opinions on this? I just wonder if I could abuse tags in this way, though (i.e. having a when: tag defined syntax). Best regards -- Branko Majic Jabber: bra...@majic.rs Please use only Free formats when sending attachments to me. Бранко Мајић Џабер

[ansible-project] Dealing with inconsistencies after failed runs

2016-03-09 Thread Branko Majic
ario possibly happens exclusively when using handlers, since those are rather stateless (I'm sure you could also trigger such behaviour with poorly designed command/shell combination of tasks). How do folks usually handle such situations? Best regards -- Branko Majic Jabber: bra...@majic.rs Pl

Re: [ansible-project] boot script

2015-02-09 Thread Branko Majic
through the Ansible tutorials first, of course. If you're trying to do something different, some more information about what you are trying to achieve, how you have tried to do it, and what issues you are having would be useful in order for people to be able to help you. Best regards -- Branko

Re: [ansible-project] how to add custom jinja filters

2014-11-26 Thread Branko Majic
/developing_plugins.html which describes most of I wrote (although, in a bit of a less verbose way, and without examples). I hope this helps. Best regards -- Branko Majic Jabber: bra...@majic.rs Please use only Free formats when sending attachments to me. Бранко Мајић Џабер: bra...@majic.rs Молим вас да

[ansible-project] Role encapsulation, DRY, and convention over configuration

2014-10-25 Thread Branko Majic
suggestions. If someone has a good link to share, which demonstrates solution for such a deployment, that'd be appreciated as well :) Best regards -- Branko Majic Jabber: bra...@majic.rs Please use only Free formats when sending attachments to me. Бранко Мајић Џабер: bra...@majic.rs Молим вас да