{"id":2211,"date":"2017-11-14T09:53:08","date_gmt":"2017-11-14T07:53:08","guid":{"rendered":"http:\/\/www.openmediavault.org\/?p=2211"},"modified":"2019-05-24T09:43:47","modified_gmt":"2019-05-24T07:43:47","slug":"remove-files-with-glob-pattern-in-saltstack","status":"publish","type":"post","link":"https:\/\/www.openmediavault.org\/?p=2211","title":{"rendered":"Remove files with glob pattern in Saltstack"},"content":{"rendered":"<p>If you want to remove files using a glob pattern the you can not use <a href=\"https:\/\/docs.saltstack.com\/en\/latest\/ref\/states\/all\/salt.states.file.html#salt.states.file.absent\">salt.states.file.absent<\/a>&nbsp;because it does not support file globbing. To workaround this you can simply use&nbsp;<a href=\"https:\/\/docs.saltstack.com\/en\/latest\/ref\/states\/all\/salt.states.file.html#salt.states.file.absent\">salt.modules.file.find<\/a>.<\/p>\n<pre class=\"lang:yaml decode:true\">remove_test_files:\n  module.run:\n    - name: file.find\n    - path: \"\/xxx\/yyy\/zzz\"\n    - kwargs:\n        iname: \"test*\"\n        delete: \"f\"\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to remove files using a glob pattern the you can not use salt.states.file.absent&nbsp;because it does not support file globbing. To workaround this you can simply use&nbsp;salt.modules.file.find. remove_test_files: module.run: &#8211; name: file.find &#8211; path: &#8220;\/xxx\/yyy\/zzz&#8221; &#8211; kwargs: iname: &#8220;test*&#8221; delete: &#8220;f&#8221; &nbsp;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-2211","post","type-post","status-publish","format-standard","hentry","category-coding"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"volker\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.openmediavault.org\/?p=2211\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211#article\",\"name\":\"Remove files with glob pattern in Saltstack | openmediavault\",\"headline\":\"Remove files with glob pattern in Saltstack\",\"author\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/header_logo.svg\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#articleImage\",\"width\":330,\"height\":42},\"datePublished\":\"2017-11-14T09:53:08+02:00\",\"dateModified\":\"2019-05-24T09:43:47+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211#webpage\"},\"articleSection\":\"Coding\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.openmediavault.org\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?cat=32#listItem\",\"name\":\"Coding\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?cat=32#listItem\",\"position\":2,\"name\":\"Coding\",\"item\":\"https:\\\/\\\/www.openmediavault.org\\\/?cat=32\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211#listItem\",\"name\":\"Remove files with glob pattern in Saltstack\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211#listItem\",\"position\":3,\"name\":\"Remove files with glob pattern in Saltstack\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?cat=32#listItem\",\"name\":\"Coding\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#organization\",\"name\":\"openmediavault\",\"description\":\"DATA SOVEREIGNTY MADE EASY\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/header_logo.svg\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211\\\/#organizationLogo\",\"width\":330,\"height\":42},\"image\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211\\\/#organizationLogo\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2#author\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2\",\"name\":\"volker\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211#webpage\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211\",\"name\":\"Remove files with glob pattern in Saltstack | openmediavault\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=2211#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2#author\"},\"datePublished\":\"2017-11-14T09:53:08+02:00\",\"dateModified\":\"2019-05-24T09:43:47+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#website\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/\",\"name\":\"openmediavault\",\"description\":\"DATA SOVEREIGNTY MADE EASY\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Remove files with glob pattern in Saltstack | openmediavault","description":"","canonical_url":"https:\/\/www.openmediavault.org\/?p=2211","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.openmediavault.org\/?p=2211#article","name":"Remove files with glob pattern in Saltstack | openmediavault","headline":"Remove files with glob pattern in Saltstack","author":{"@id":"https:\/\/www.openmediavault.org\/?author=2#author"},"publisher":{"@id":"https:\/\/www.openmediavault.org\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.openmediavault.org\/wp-content\/uploads\/2025\/10\/header_logo.svg","@id":"https:\/\/www.openmediavault.org\/#articleImage","width":330,"height":42},"datePublished":"2017-11-14T09:53:08+02:00","dateModified":"2019-05-24T09:43:47+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.openmediavault.org\/?p=2211#webpage"},"isPartOf":{"@id":"https:\/\/www.openmediavault.org\/?p=2211#webpage"},"articleSection":"Coding"},{"@type":"BreadcrumbList","@id":"https:\/\/www.openmediavault.org\/?p=2211#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/#listItem","position":1,"name":"Home","item":"https:\/\/www.openmediavault.org\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?cat=32#listItem","name":"Coding"}},{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?cat=32#listItem","position":2,"name":"Coding","item":"https:\/\/www.openmediavault.org\/?cat=32","nextItem":{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?p=2211#listItem","name":"Remove files with glob pattern in Saltstack"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?p=2211#listItem","position":3,"name":"Remove files with glob pattern in Saltstack","previousItem":{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?cat=32#listItem","name":"Coding"}}]},{"@type":"Organization","@id":"https:\/\/www.openmediavault.org\/#organization","name":"openmediavault","description":"DATA SOVEREIGNTY MADE EASY","url":"https:\/\/www.openmediavault.org\/","logo":{"@type":"ImageObject","url":"https:\/\/www.openmediavault.org\/wp-content\/uploads\/2025\/10\/header_logo.svg","@id":"https:\/\/www.openmediavault.org\/?p=2211\/#organizationLogo","width":330,"height":42},"image":{"@id":"https:\/\/www.openmediavault.org\/?p=2211\/#organizationLogo"}},{"@type":"Person","@id":"https:\/\/www.openmediavault.org\/?author=2#author","url":"https:\/\/www.openmediavault.org\/?author=2","name":"volker"},{"@type":"WebPage","@id":"https:\/\/www.openmediavault.org\/?p=2211#webpage","url":"https:\/\/www.openmediavault.org\/?p=2211","name":"Remove files with glob pattern in Saltstack | openmediavault","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.openmediavault.org\/#website"},"breadcrumb":{"@id":"https:\/\/www.openmediavault.org\/?p=2211#breadcrumblist"},"author":{"@id":"https:\/\/www.openmediavault.org\/?author=2#author"},"creator":{"@id":"https:\/\/www.openmediavault.org\/?author=2#author"},"datePublished":"2017-11-14T09:53:08+02:00","dateModified":"2019-05-24T09:43:47+02:00"},{"@type":"WebSite","@id":"https:\/\/www.openmediavault.org\/#website","url":"https:\/\/www.openmediavault.org\/","name":"openmediavault","description":"DATA SOVEREIGNTY MADE EASY","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.openmediavault.org\/#organization"}}]}},"aioseo_meta_data":{"post_id":"2211","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"limit_modified_date":false,"ai":null,"created":"2020-12-24 17:43:51","updated":"2022-09-17 18:03:51","breadcrumb_settings":null,"seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.openmediavault.org\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.openmediavault.org\/?cat=32\" title=\"Coding\">Coding<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRemove files with glob pattern in Saltstack\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.openmediavault.org\/"},{"label":"Coding","link":"https:\/\/www.openmediavault.org\/?cat=32"},{"label":"Remove files with glob pattern in Saltstack","link":"https:\/\/www.openmediavault.org\/?p=2211"}],"_links":{"self":[{"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/posts\/2211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2211"}],"version-history":[{"count":2,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/posts\/2211\/revisions"}],"predecessor-version":[{"id":2579,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/posts\/2211\/revisions\/2579"}],"wp:attachment":[{"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}