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 answers
Related Questions in ANSIBLE
- Kubernetes cluster on GCE connection refused error
- editing pass option in /etc/fstab with ansible
- Ansible role analysis with Checkov - facts evaluation?
- read contents from a file on git using ansible
- Upgrade Gitlab-runner package in amazon Linux 2 and Ubuntu 22.04 through Ansible
- Ansible - Copy Same File to Many Different Paths
- Execute handler as idempotent approach
- How to discern, whether Ansible runs in color mode?
- ansible + packer +windows ami giving "msg": "winrm or requests is not installed: No module named 'winrm'"
- Moving Template or OVA to Datastore using vCenter API
- Ansible - Trouble with conditional
- Increment number on each node with excluding one
- How can I run a command before the playbook when using ansible ee?
- Connect ssh to cisco switch with ansible
- How to use the Ansible Shell module on Linux to start Node.js server in the background?
Related Questions in JINJA2
- how to control jinja loop using javascript
- how do ı connect html files each other with jinja?
- Visual Studio modifying code when running debugger, replacing == with a space in the middle
- "jinja2.exceptions.TemplateNotFound" error when attempting to access JavaScript file
- How to pass JSON with newline \n from flask backend to Jinja2 and JQuery frontend?
- sqlfluff: Undefined jinja template variable: 'dbt_utils'
- Use Better Jinja together with HTMLHint?
- Access variable in Jinja file from python module
- Automatically modify variables rendered in jinja2 template
- why jinja2's function FileSystemLoader() doesn't work
- 2nd flashed message cant be closed?
- Jinja templating of lists in Ansible vars files without 'max recursion depth reached' or blank items
- How call a function using onClick in a jinja/flask button
- Flask/Jinja, Multiple Template Inheritance, cannot inherit a block across multiple templates
- How to combine items from a Dictionary into a list of dictionaries based on matching key/value details
Related Questions in ANSIBLE-FACTS
- Ansible Array Variables
- classic solution to detect unreachable host in ansible does not work for a single host
- How to detect if host is WSL in Ansible playbook?
- Using `lineinfile` to add a host variable in Ansible YAML inventory?
- Ansible variables and `gather_subset`
- Ansible task that ends all plays defined in playbook yaml file
- Changing `fact_path` in `ansible.cfg` does nothing
- I want to print a specific line/value in my stdout using ansible
- How does Ansible determine what version of a module to use (Windows/Unix)?
- Search for an interface using its MAC address
- Conditional task if a variable is set
- Ansible: How To Compare 1 Host's Services with Multiple Host's Services?
- unable to use set_fact in ansible
- Ansible - How to patch systems in an order and based on the operating system?
- How do I `hostnamectl set-icon-name` via Ansible?
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?
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)
You can use
selectfilter withmatchtest:Using
map('regex_replace','^','/dev/')to prepend every string in a list is fine.