Comments (3)
Yeah, include_role
also works, but the advantage of the approach I suggested is it allows you to sequence gantsign.oh-my-zsh
relative to other roles in the playbook in the normal way. With include_role
you're limited to before (pre_tasks
) or after (tasks
or post_tasks
) all the other roles in the playbook (unless you invoke them with include_role
as well).
from ansible-role-oh-my-zsh.
Hi @Gictorbit, unfortunately, loop
doesn't work with Ansible roles (only with tasks). Try the following instead:
- name: setup ohmyzsh for users
hosts: all
vars:
userlist:
- username: "viktor"
password: "viktor123"
become: yes
pre_tasks:
- name: build oh_my_zsh_users
set_fact:
oh_my_zsh_users: '{{ (oh_my_zsh_users | default([])) + [oh_my_zsh_user] }}'
vars:
oh_my_zsh_user:
username: '{{ item.username }}'
oh_my_zsh:
theme: gnzh
plugins:
- git
- zsh-syntax-highlighting
- zsh-autosuggestions
- docker
loop: '{{ userlist }}'
roles:
- role: gantsign.oh-my-zsh
users: '{{ oh_my_zsh_users }}'
from ansible-role-oh-my-zsh.
Thank you, I also asked this question in stack overflow and solved this using include_role
you can check that from link below:
stack overflow
from ansible-role-oh-my-zsh.
Related Issues (20)
- Error when installing role on OSX HOT 1
- Does not work as expected HOT 2
- Feature Request: Custom plugin installation HOT 5
- Prexis the users variable HOT 1
- Customising .zshrc HOT 2
- Disabled updated HOT 6
- change in theme/plugins doesn't make it to .zshrc HOT 3
- Whitelist Dependabot in cla-assistant
- Missing acl package in oh_my_zsh_dependencies HOT 2
- Add option to skip default .zshrc file creation HOT 5
- What should I do to make zsh-autosuggestions work? HOT 3
- Install custom themes and plugins
- chmod: invalid mode HOT 1
- Add support for Fedora 25
- Add support for OpenSUSE 42.2
- `users` variable name too generic HOT 1
- Temp file issues HOT 2
- Allow overriding .zshrc templates HOT 1
- Unable to write .zshrc while connected with unprivilegied user HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-oh-my-zsh.