I have a requirement to build two logical volumes. sda1 will always form /root and be partitioned up for logs and such, but /application may include anywhere from one to four additional disks. I know they will always begin with sdb and continue on to sde or sdf. I can think of a couple of different quick and dirty solutions like just running a bash command that builds a list to be registered as a variable, but what I would like to do instead is pull down from the ansible_devices part of Ansible setup facts and match a regex of sd[b-z]. I know it's unlikely I will ever have an sdz, but I want to keep this as flexible as possible. Does anyone have a good technique for this? Is a jinja2 filter the wrong approach?
Loop over ansible_devices and select any physical disk that is not sda for inclusion into volume group
2.1k Views Asked by eightbitdino At
1
There are 1 best solutions below
Related Questions in ANSIBLE
- What is a 'map' in terms of Ansible variables?
- Vagrant - Ansible error installing Apache
- How can I pass variable to ansible playbook in the command line?
- How to add apt key with --recv-keys instead of --recv?
- Ansible inventory parameters for pem key
- Ansible git clone 'Permission Denied' but direct git clone working
- Register variable in ansible and using custom filter in when
- Ansible git clone as root
- Ansible - conditionally include a file in a role
- Extracting file persmission data in Ansible
- Apt install with ansible
- Ansible-pull with no inventory limitations
- template task: write to root owned directory
- Variable that has the path to the current ansible-playbook that is executing?
- ansible playbook execute in this order: task, role, task, role, task
Related Questions in JINJA2
- Any way to use jinja2 and flask form instead of ajax and jquery or both?
- Does jinja2 have filter help show only part of variable in browser
- Creating 2 dimensional array in Python Flask application Jinja2 Template
- View each result of a query with Jinja , python
- Jinja2 find_undeclared_variables ignores globals?
- I am working on small project with Google AppEngine (Python), tutored by Udacity. I am unable to render user comments to main page
- Turn off auto-conversion to string of jinja2 expressions
- Jinja macro doesn't see value passed to render_template
- Creating reusable forms/views in Flask
- Ansible: How can I set serial numbers for hosts
- Jinja2 templates If condition not working correctly
- What is meaning of gettext('Some Text') in Openstack
- for loop inside a flask function -Internal server error
- Ansible jinja2 filters '|'(pipe) what does it mean?
- How to import Python modules for user in Jinja2 template
Related Questions in ANSIBLE-FACTS
- Ansible: How to use multi-value data list as inventory and pass to target host
- Fact access from another role in Ansible
- How to regex replace nested values in Ansible
- Loop over ansible_devices and select any physical disk that is not sda for inclusion into volume group
- Ansible doesn't return correct group_vars, why?
- ansible playbook is failing
- ansible assign a fact value to a variable
- How to Club multiple ansible condition into one based on the set_facts
- How to get the particular index value of a combined list for a desired position ansible
- Ansible fact is undefined error in conditional
- Is there a list of tags accessible inside playbook?
- How do I `hostnamectl set-icon-name` via Ansible?
- Convert win_service_info dictionary to lowercase
- Ansible: How To Compare 1 Host's Services with Multiple Host's Services?
- unable to use set_fact in ansible
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can use
selectfilter withmatchtest:Using
map('regex_replace','^','/dev/')to prepend every string in a list is fine.