regex - How to specify case insensitive mode in ansible lineinfile regexp? -


simple question. i'm trying match "usedns", "usedns" , other variations. - name: disable dns checking on login (huge speedup) sudo: true lineinfile: dest: "/etc/ssh/sshd_config" regexp: "^[# \t]*[uu][ss][ee][dd][nn][ss] " # how 1 specify case insensitive regexp in lineinfile? line: "usedns no" state: "present" create: true insertafter: eof notify: - sshd restart

ansible uses python re module. can use inline modifiers, such (?ism) in pattern. use i case-insensitive matching:

regexp:   "(?i)^[# \t]*usedns " 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -