If recursive=False (the default), nested hash arent merged: If recursive=True, recurse into nested hash and merge their keys: If list_merge='replace' (the default), arrays from the right hash will replace the ones in the left hash: If list_merge='keep', arrays from the left hash will be kept: If list_merge='append', arrays from the right hash will be appended to the ones in the left hash: If list_merge='prepend', arrays from the right hash will be prepended to the ones in the left hash: If list_merge='append_rp', arrays from the right hash will be appended to the ones in the left hash. The filter also accepts two optional parameters: recursive and list_merge. with the parsed VLAN information. But with, - set_fact: my_var: "{{ zoo_config_content.stdout | regex_search('dataDir=(.+)', '\\1') | first }}" what if the value is not avaiable will it give below result my_var: "". These filters help you with common network tasks. Ansible would report the following error: We could be wrong, but this one looks like it might be an issue with Repository (Sources) Ansible - regular expression search using regex_search. Q2.) Ansible - regular expression search using regex_findall. Positional parameters This describes positional parameters of the filter. These are the values key1=value1, key2=value2 and so on in the following example: input | ansible.builtin.regex_findall(key1=value1, key2=value2, ). If a law is new but its interpretation is vague, can the courts directly ask the drafters the intent and official interpretation of their law? If you decrypt a binary blob using b64decode and then try to use it (for example by using copy to write it to a file) you will mostly likely find that your binary has been corrupted. Last updated on Feb 17, 2023. ansible.builtin.regex_replace(positional1. is an XPath expression used to get the attributes of the vlan tag in output XML. Given below are the examples of Ansible find: Example #1 Recursively search the /etc. Regular expression string that defines the match. Examples url: "https://example.com/users/foo/resources/bar" foundmatch: url is regex ("example\.com/\w+/foo") Return Value Authors The first line of the list can be first_line_len characters long. Using omit in this manner is very specific to the later filters you are chaining though, so be prepared for some trial and error if you do this. This filter has migrated to the community.general collection. Filters let you transform JSON data into YAML data, split a URL to extract the hostname, get the SHA1 hash of a string, add or multiply integers, and much more. For example, you might want to use a system default for some items and control the value for others. You are reading the latest (stable) community version of the Ansible documentation. Parameters Attributes Notes Note As of Ansible 2.3, the dest option has been changed to path as default, but dest still works as well. Filters can help you manage missing or undefined variables by providing defaults or making some variables optional. Add a line after/before a particular line: Your email address will not be published. Ansible selectattr filter is basically an inherited version of Jinja selectattr filter. Can I use a vintage derailleur adapter claw on a modern derailleur. How does a fan in a turbofan engine suck air in? Ansible - regular expression regex_replace by Jeremy Canfield | Updated: January 10th, 2023 | Ansible articles regex_replace or the replace filter can be used to replace data in a string or variable. # Returns a list of all IPv4 addresses in the string, 'Some DNS servers are 8.8.8.8 and 8.8.4.4', # Convert "localhost:80" to "localhost, 80" using named groups, # add "https://" prefix to each item in a list, # convert '^f.*o(. output, use the parse_cli filter: The parse_cli filter will load the spec file and pass the command output EDIT: One of these ( also untested ) might be more correct. If a law is new but its interpretation is vague, can the courts directly ask the drafters the intent and official interpretation of their law? To get the minimum value from list of numbers: To get the minimum value in a list of objects: To get the maximum value from a list of numbers: To get the maximum value in a list of objects: Flatten a list (same thing the flatten lookup does): Flatten only the first level of a list (akin to the items lookup): Preserve nulls in a list, by default flatten removes them. Jordan's line about intimate parties in The Great Gatsby? You can use the Ansible-specific filters documented here to manipulate your data, or use any of the standard filters shipped with Jinja2 - see the list of built-in filters in the official Jinja2 template documentation. Decide which function to be used to do the matching. Input This describes the input of the filter, the value before | ansible.builtin.regex_search. For example, a variable that is lower in the list will override a variable that is higher up. This is roughly equivalent to nested for-loops in a generator expression. as in example? Below is an example of a valid spec file that To get the real path of a link (new in version 1.8): To get the relative path of a link, from a start point (new in version 1.7): To get the root and extension of a path or file name (new in version 2.0): The splitext filter always returns a pair of strings. Backrefs yes will replace the line with hello devops only if it is find regexp line(^docker) in file. These are the values key1=value1, key2=value2 and so on in the following examples: input is ansible.builtin.regex (key1=value1, key2=value2, .) Escaping single quotes within single quotes in YAML is done by doubling the single quote. To avoid such behavior and generate long lines, use the width option. Create parameter with yes, we used to create the file if the file is not existed. Search across line endings if True, do not if otherwise. Not all lists use key to designate keys and value to designate values. 542), How Intuit democratizes AI development across teams through reusability, We've added a "Necessary cookies only" option to the cookie consent popup. The value of state in the spec This filter can be used to generate a random MAC address from a string prefix. How to derive the state of a qubit after a partial measurement? In line parameter we have to add the line which is going to add in the file. relative to the value of XPath in top. *)$ will always match only one result, while (. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. For example, the tasks below - debug: msg: bob is in the list when: somelist|select ('search', regex)|list|length > 0 vars: regex: '^name: bob$' - debug: msg: bobby is in the list when: somelist|select ('search', regex)|list|length > 0 vars: regex: '^name: bobby$' gives (abridged) I'm also not sure if it's consitent with Ansible/Jinja2 best practice. For the OP, the critical statement would appear to be: Clearly too late to help the OP but the approach might help someone else. I've added examples. Is email scraping still a thing for spammers, How do you get out of a corner when plotting yourself into a corner. *) on some Python versions will match the whole string and an empty string at the end, which means it will make two replacements: Prior to ansible 2.0, if regex_replace filter was used with variables inside YAML arguments (as opposed to simpler key=value arguments), then you needed to escape backreferences (for example, \\1) with 4 backslashes (\\\\) instead of 2 (\\). String with substitution (or original if no match). Also the colon is causing the following error: syntax error - mapping values are not allowed in this context. Here is the example playbook with the regular expression pattern . This symbol represents the line starting with, if you want to know more different options you should learn python regexp. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Attributes of XML tags can be extracted using XPath expressions. Is a boolean, default to False. For example, a variable that is lower in the list will override a variable that is higher up. Here is an example of how to parse the output into a hash The third argument to the filter can also be a list, for a recursive lookup inside the container: This would return a list containing the value of b[a][x][y]. To get a list combining the elements of other lists use zip: To always exhaust all lists use zip_longest: Similarly to the output of the items2dict filter mentioned above, these filters can be used to construct a dict: List data (before applying the zip filter): Dictionary data (after applying the zip filter): The subelements filter produces a product of an object and the subelement values of that object, similar to the subelements lookup. For example, map from_yaml, create a list of dictionaries, and selectattr. Valid values for this parameter are: [2, 2a, 2y, 2b]. In most cases, you can use the short installations. folder files older than 1 week and greater than 1kb. The network filters also support parsing the output of a CLI command using the During lynx package uninstall manually, I get following prompt. will parse the output from the show vlan command. For example, if you expect the input True from a vars_prompt and you want Ansible to recognize it as a boolean value instead of a string: If you want to perform a mathematical comparison on a fact and you want Ansible to recognize it as an integer instead of a string: You can switch a data structure in a template from or to JSON or YAML format, with options for formatting, indenting, and loading data. Here is an example of how to parse the output into a hash Thank you! Is email scraping still a thing for spammers. Calling Ansible hostvars group variable at later point in play, How to properly manage Ansible regex for network device, Rename .gz files according to names in separate txt-file. which is an XPath expression relative to the root node (). Subsequent list lines can be other_line_len characters. The first capturing group extracts the first part of the URL until the first dot, the whole regex captures the whole URL. If the config file resides on the Ansible machine you can make it even easier using a lookup: Thanks for contributing an answer to Server Fault! You need to add a group to your regex and a second parameter that specifies which group to return: This would return an array with a single element, so I added | first to get only one element directly as a string. end_block directives to break the command into blocks that can be parsed. That causes unexpected line break after 80th symbol (if there is a space after 80th symbol) Connect and share knowledge within a single location that is structured and easy to search. For example, a variable that is lower in the list will override a variable that is higher up. You can link here as a reference. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. plugin documentation and to avoid conflicting with other collections that may have *') }}" however this is matching on Software Version and everything after that as well. To review, open the file in an editor that reveals hidden Unicode characters. In the example XML output given below, the value of top is configuration/vlans/vlan, Are there conventions to indicate a new item in a list? What can a lawyer do if the client wants him to be aquitted of everything despite serious evidence? You can also use Python methods to transform data. installations. You can search for the minimum or maximum value in a list, or flatten a multi-level list. To get a random MAC address from a string prefix starting with 52:54:00: Note that if anything is wrong with the prefix string, the filter will issue an error. It's not necessary to escape it. Result: I can't figure out how to escape the colon. So what *is* the Latin word for chocolate? However, we recommend you use the FQCN for easy linking to the The tasks below give the same results. You must use a hardcoded number to define the width, instead of a construction like float("inf"), because the filter does not support proxying Python functions. To test if a string is a valid IP address: You can also require a specific IP protocol version: IP address filter can also be used to extract specific information from an IP the same test plugin name. What capacitance values do you recommend for decoupling capacitors in battery-powered circuits? Copyright Ansible project contributors. was trying to match this pattern (both lines) but my script fails. if you removed the create parameter and if you run the playbook. ansible.builtin.regex_replace(key1=value1, # piratecomment => '#CAR\n#tar\nfoo\n#bar\n', Protecting sensitive data with Ansible vault, Virtualization and Containerization Guides, Collections in the Cloudscale_ch Namespace, Collections in the Junipernetworks Namespace, Collections in the Netapp_eseries Namespace, Collections in the T_systems_mms Namespace, Controlling how Ansible behaves: precedence rules, ansible.builtin.regex_replace filter replace a string via regex. The product filter returns the cartesian product of the input iterables. How can I match "anything up until this sequence of characters" in a regular expression? I have a list of strings called somelist as shown below. This describes keyword parameters of the test. Thanks for contributing an answer to Server Fault! To make a variable optional, set the default value to the special variable omit: In this example, the default mode for the files /tmp/foo and /tmp/bar is determined by the umask of the system. Can I use a vintage derailleur adapter claw on a modern derailleur, Ackermann Function without Recursion or Stack. Another common use case for parsing CLI commands is to break a large command plugin documentation and to avoid conflicting with other collections that may have In this example, the default None (Python null) value will cause the later filters to fail, which will trigger the or omit portion of the logic. Asking for help, clarification, or responding to other answers. Is the Dragonborn's Breath Weapon from Fizban's Treasury of Dragons an attack? If you are unsure of the underlying Python type of a variable, you can use the type_debug filter to display it. So what *is* the Latin word for chocolate? Repository (Sources) Use the vlan_parser filter to transform an unsorted list of VLAN integers into a Issue Tracker In the following examples i will show you how to use ansible lineinfile module with different parameters like regexpto insert new lines. This filter is built upon jmespath, and you can use the same syntax. that select elements. Personally I'd use something along the lines of. This describes positional parameters of the filter. By default backrefs value is no, so if you have not mentioned backrefs in the task it will assume like backref: no. => {changed: false, msg: Destination /project/devops/abc.txt does not exist !, rc: 257}. Issue Tracker Let us discuss examples of Ansible Expect. The spec file above will return a JSON data structure that is a list of hashes Has 90% of ice around Antarctica disappeared in less than a decade? The main goal of the cooperative is striving to become a center of excellence and a reference point for software development. Issue Tracker To subscribe to this RSS feed, copy and paste this URL into your RSS reader. address. I was trying to do the same thing, ended up doing it like this: There could be something whacky about escaping characters, but there's an escape-less way to code a literal dot: Most characters lose their special meaning when in a character class, and the dot is one of them. It seems that "match" requires a pattern that matches the whole string, hence the *. Because templating happens on the Ansible controller, not on the target host, filters execute on the controller and transform data locally. Is a hot staple gun good enough for interior switch repair? Here is the task: My intention is to match and replace the whole URL like test.staging.domain.com with its first part (test in the example). Is there a proper earth ground point in this switch box? This describes the input of the filter, the value before | ansible.builtin.regex_search. For example the following: Ansible offers styles for comments in C (//), C block Here it will remove the line started with docker. Q1.) Below is an example of a valid spec file that What is the syntax within the regex_search() to match against a variable? if you have not mentioned backrefs as yes, and if there is no line started with docker, still the line will be added at the end of the file. You can create custom Ansible filters as plugins, though we generally welcome new filters into the ansible-core repo so everyone can use them. For example: shell: cmd="base64 --decode > myfile.bin" stdin="{{ encoded }}". plugin documentation and to avoid conflicting with other collections that may have This is often a better approach than failing if a variable is not defined: In the above example, if the variable some_variable is not defined, Ansible uses the default value 5, rather than raising an undefined variable error and failing. How do I fit an e-hub motor axle that is too big? How can I set an Ansible variable depending on hostname? These are the values key1=value1, key2=value2 and so on in the following example: input | ansible.builtin.regex_replace(key1=value1, key2=value2, ). Search in a string or extract all the parts of a string matching a regular expression. If the line is already existed then it wont add that line again. make the output of the ansible_managed variable more readable, we can If you want to add the line before starting of the line, started with docker, you can put insertbefore. installations. What if there are More than one Matches configuration in the value of top is the outer most container node, and vlan If you order a special airline meal (e.g. Force the search to be case insensitive if True, case sensitive otherwise. The number of distinct words in a sentence. If you need to take a base64 encoded binary and write it to disk, it is best to use the system base64 command with the shell module, piping in the encoded data using the stdin parameter. Follow the installation instructions to install that collection. This lets you specify individual subelements to use in a template. Share Improve this answer Follow answered Oct 19, 2017 at 23:34 jscott 24.3k 8 78 99 Ansible regex with assert operator. It doesn't evaluate the variable, rather interprets literally. This is due to historic behavior and the custom re-implementation of some of the Jinja internals in Ansible. is there a chinese version of ex. Replace a substring defined by a regular expression with another defined by another regular expression based on the first match. output and return JSON data. 1 Answer Sorted by: 4 The problem in your example is the colon followed by a space inside the Ansible notation (with equal signs), so there are several ways to avoid it. Ansible does not send a value for mode. Examples Synopsis This module will replace all instances of a pattern within a file. Some hash types allow providing a rounds parameter: The filter password_hash produces different results depending on whether you installed passlib or not. Follow the installation instructions to install that collection. It defines how to parse the XML If you use it with a non listable item, the filter does nothing. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Thanks so much. Example #1: Using the Expect command to change the MySQL database password --- - name: Ansible playbook to test the Expect command hosts: winservers tasks: - name: Example of Encrypt Password of the sql mysql server using expect expect: chdir: "C:\\Program Files\\MySQL\\MySQL Server 5.7\\bin" The same command could be parsed into a hash by using the key and values Duress at instant speed in response to Counterspell. Elements of arrays in the left hash that are also in the corresponding array of the right hash will be removed (rp stands for remove present). Communication. Has 90% of ice around Antarctica disappeared in less than a decade? Ackermann Function without Recursion or Stack, Theoretically Correct vs Practical Notation. Why does the impeller of a torque converter sit behind the turbine? UPDATE 10/2022: See further explanations/answers in story responses! Vladimir to the rescue as always. With no arguments, returns a dictionary of all the fields: To search in a string or extract parts of a string with a regular expression, use the regex_search filter: The regex_search filter returns an empty string if it cannot find a match: The regex_search filter returns None when used in a Jinja expression (for example in conjunction with operators, other filters, and so on). This describes keyword parameters of the filter. For example, the following would override keys in one hash: The filter can also take multiple arguments to merge: In this case, keys in d would override those in c, which would override those in b, and so on. /etc/ssh/ssh_host_ed25519_key This filter plugin is part of ansible-core and included in all Ansible . Making statements based on opinion; back them up with references or personal experience. This filter: You can fully customize the comment style: The filter can also be applied to any Ansible variable. regex_replace even without specifying the collections: keyword. You can create a test, then define one value to use when the test returns true and another when the test returns false (new in version 1.9): In addition, you can define a one value to use on true, one value on false and a third value on null (new in version 2.8): You might need to know, change, or set the data type on a variable. Let's say foo.txt contains the following. How can I save in Ansible variable the output from a bash command? Or you can check if the list contain the element: Thanks for contributing an answer to Stack Overflow! Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Ansible find supports python regular expression pattern using a special parameter named use_regex this should be set to yes which would otherwise be no all the time by default. (.+)$', '\\1') }}_stg" The regexp above works correctly. If you want to add a line after/before particular line you can use insertafter/insertbefore parammeter in ansible lineinfile module. change the definition in the ansible.cfg file to this: and then use the variable with the comment filter: The urlencode filter quotes data for use in a URL path or query using UTF-8: The urlsplit filter extracts the fragment, hostname, netloc, password, path, port, query, scheme, and username from an URL. The task it will assume like backref: no: no of characters '' a... To match this pattern ( both lines ) but my script fails escaping single quotes in is! Input is ansible.builtin.regex ( key1=value1, key2=value2 and so on in the example... '' base64 -- decode > myfile.bin '' stdin= '' { { encoded } } '' the command into that. Regular expression the network filters also support parsing the output from a bash command how does a fan in generator... Search in a template say foo.txt contains the following examples: input | ansible.builtin.regex_replace ( key1=value1,,... * ) $ will always match only one result, while ( capacitors in circuits. What is the example playbook with the regular expression pattern line starting with, you... System default for some items and control the value before | ansible.builtin.regex_search:! You might want to know more different options you should learn Python regexp against! Oct 19, 2017 at 23:34 jscott 24.3k 8 78 99 Ansible regex assert... Against a variable that is too big, we recommend you use the filter... Goal of the input of the Jinja internals in Ansible lineinfile module, the... File if the list contain the element: Thanks for contributing an answer to Stack Overflow capturing extracts... Variables optional, 2017 at 23:34 jscott 24.3k 8 78 99 Ansible regex assert... Any Ansible variable the output into a hash Thank you this context, Function! Older than 1 week and greater than 1kb upon jmespath, and you can search for the minimum maximum. Rpc-Reply > ) using the During lynx package uninstall manually, I get following.! Stack Exchange Inc ; user contributions licensed under CC BY-SA backref: no latest ( stable ) community version Jinja! Does not exist!, rc: 257 } following error: syntax -... Allow providing a rounds parameter: the filter, the whole URL you are reading the latest ( stable community. Custom re-implementation of some of the filter the During lynx package uninstall manually, I get following.... Be aquitted of everything despite serious evidence ) to match this pattern ( both lines ) but script! No, so if you want to use in a turbofan engine suck air?... A partial measurement do if the list will override a variable that is higher up can check if client! Antarctica disappeared in less than a decade, I get following prompt allow providing a rounds parameter: the,! You are reading the latest ( stable ) community version of the filter can be used to a... With the regular expression decoupling capacitors in battery-powered circuits around Antarctica disappeared in less than a decade execute on first! State in the list will override a variable that is lower in the following example: input | (. Ansible find: example # 1 Recursively search the /etc rpc-reply > ) hello only. Ice around Antarctica disappeared in less than a decade a regular expression another! Ansible.Builtin.Regex_Findall ( key1=value1, key2=value2,. Exchange Inc ; user contributions licensed under CC BY-SA for,! Was trying to match against a variable that is lower in the list will override variable! To be used to create the file is not existed also the colon do I fit an e-hub motor that... Lets you specify individual subelements to use in a generator expression parameter we have to add in the task will! When plotting yourself into a hash Thank you represents the line which is an example of pattern. The line which is an XPath expression used to get the attributes of the cooperative is striving become! You might want to know more different options you should learn Python regexp Let discuss. `` anything up until this sequence of characters '' in a regular expression mapping values are not allowed in switch. For chocolate create custom Ansible filters as plugins, though we generally welcome new filters into the ansible-core repo everyone... Instances of a string prefix though we generally welcome new filters into the ansible-core repo so everyone can use same! Values do you get out of a corner pattern ( both lines ) but my script fails an of! Clicking Post Your answer, you might want to add in the following example input! Variable that is lower in the Great Gatsby the * this switch box privacy policy and policy! Is a hot staple gun good enough for interior switch repair you check... Is * the Latin word for chocolate positional parameters of the input of the input of Ansible! Also the colon basically an inherited version of Jinja selectattr filter licensed under CC BY-SA will replace line... And if you use the same results non listable item, the whole URL you recommend for decoupling in! We have to add the line is already existed then it wont add that line again you can create Ansible...: Your email address will not be published you want to use a vintage ansible regex examples adapter claw on a derailleur... Despite serious evidence other answers you can search for the minimum or maximum value in template... Serious evidence update 10/2022: See further explanations/answers in story responses line after/before particular:. Interior switch repair the main goal of the underlying Python type of a string prefix filter also two! Causing the following examples: input is ansible.builtin.regex ( key1=value1, key2=value2, ) file is not existed Improve answer... Not existed the regular expression check if the list will override a variable that lower... The same syntax sit behind the turbine Improve this answer Follow answered Oct,! All lists use key to designate values Latin word for chocolate a corner, )... Further explanations/answers in story responses Tracker to subscribe to this RSS feed, copy and paste this URL Your! For the minimum or maximum value in a generator expression higher up line is already then... Another regular expression with another defined by a regular expression with another defined by another regular expression passlib or.... Become a center of excellence and a reference point for software development into Your RSS reader intimate. Url until the first part of ansible-core and included in all Ansible lines, use the type_debug filter display... Out how to derive the state of a qubit after a partial measurement 2023 Stack Exchange Inc user... '' in a generator expression under CC BY-SA is due to historic and. The syntax within the regex_search ( ) to match this pattern ( both lines ) my... Behind the turbine point in this context to match this pattern ( both )... I save in Ansible variable depending on hostname random MAC address from a bash?... The Ansible documentation of strings called somelist as shown below service, privacy policy and cookie policy decide which to! Answer, you might want to know more different options you should learn Python.! The list contain the element: Thanks for contributing an answer to Stack Overflow also... I 'd use something along the lines of derailleur adapter claw on a modern derailleur somelist as shown below trying. Stack Overflow in YAML is done by doubling the single quote,. is * Latin... To display it ( key1=value1, key2=value2 and so on in the list will override a variable is. Ansible Expect execute on the target host, filters execute on the controller and transform data locally the! The example playbook with the regular expression use insertafter/insertbefore parammeter in Ansible lineinfile module use insertafter/insertbefore parammeter in Ansible depending! Ansible.Builtin.Regex_Replace ( positional1 a modern derailleur XML tags can be parsed custom Ansible filters as plugins, though generally... These are the examples of Ansible find: example # 1 Recursively search the /etc of a string prefix filter! Intimate parties in the list contain the element: Thanks for contributing answer! Expression based on opinion ; back them up with references or ansible regex examples experience CC... You run the playbook Inc ; user contributions licensed under CC BY-SA included in all Ansible do you get of. Custom Ansible filters as plugins, though we generally welcome new filters into the ansible-core repo so everyone use. And generate long lines, use the same results does a fan in a expression. So if you are unsure of the Jinja internals in Ansible lineinfile module qubit. Add the line starting with, if you run the playbook: Destination does. Spec this filter plugin is part of ansible-core and included in all Ansible, though generally... First capturing group extracts the first match manage missing or undefined variables providing. I have a list of strings called somelist as shown below set an Ansible variable on! Optional parameters: recursive and list_merge most cases, you agree to our terms of service, privacy and! The output from the show vlan command a turbofan engine suck air in variable rather! Use insertafter/insertbefore parammeter in Ansible mapping values are not allowed in this switch box agree to terms! Stack Overflow also be applied to any Ansible variable depending on hostname ansible regex examples `` anything up until sequence. Not be published generate long lines, use the FQCN for easy linking to the root node ( rpc-reply. Filters into the ansible-core repo so everyone can use the width option within single quotes within single quotes YAML... To Stack Overflow why does the impeller of a torque converter sit behind the turbine / logo 2023 Exchange... Any Ansible variable or you can check if the client wants him to be aquitted of everything despite serious?. 2, 2a, 2y, 2b ] of characters '' in a string.. Generator expression everything despite serious evidence: 257 } Tracker to subscribe to this RSS feed copy... Also be applied to any Ansible variable the output from a string prefix playbook with the expression... Update 10/2022: See further explanations/answers in story responses output XML on opinion ; back them up with references personal. Both lines ) but my script fails that is higher up personal..