- name: Enable locale languages lineinfile: dest: /etc/locale.gen regexp: "{{item.regexp}}" line: "{{item.line}}" state: present with_items: - regexp: "^# es_ES.UTF-8 UTF-8" line: "es_ES.UTF-8 UTF-8" - regexp: "^# en_US.UTF-8 UTF-8" line: "en_US.UTF-8 UTF-8" - name: Generate locale command: locale-gen - name: Update locale command: update-locale LANG=en_US.UTF-8