diff --git a/Ansible/BaseTask/Type.dhall b/Ansible/BaseTask/Type.dhall index 4224373..6997aea 100644 --- a/Ansible/BaseTask/Type.dhall +++ b/Ansible/BaseTask/Type.dhall @@ -23,4 +23,6 @@ , failed_when : Optional Text , changed_when : Optional Text , when : Optional Text +, import_tasks : Optional Text +, add_host : Optional ../Builtin/AddHost/Type.dhall } diff --git a/Ansible/BaseTask/default.dhall b/Ansible/BaseTask/default.dhall index a0c3dd2..727efa5 100644 --- a/Ansible/BaseTask/default.dhall +++ b/Ansible/BaseTask/default.dhall @@ -1,4 +1,5 @@ { action = None Text +, add_host = None ../Builtin/AddHost/Type.dhall , async_val = None Natural , become = None Bool , become_flags = None Text @@ -10,6 +11,7 @@ , delegate_to = None Text , failed_when = None Text , ignore_errors = None Bool +, import_tasks = None Text , listen = None Text , loop = None Text , loop_control = None ./loop_control.dhall diff --git a/Ansible/Builtin/Apt/Type.dhall b/Ansible/Builtin/Apt/Type.dhall index 072c0f1..36d6b8f 100644 --- a/Ansible/Builtin/Apt/Type.dhall +++ b/Ansible/Builtin/Apt/Type.dhall @@ -1,8 +1,10 @@ -{ allow_downgrade : Optional Bool +{ allow_change_held_packages : Optional Bool +, allow_downgrade : Optional Bool , allow_unauthenticated : Optional Bool , autoclean : Optional Bool , autoremove : Optional Bool , cache_valid_time : Optional Natural +, clean : Optional Bool , deb : Optional Text , default_release : Optional Text , dpkg_options : Optional Text diff --git a/Ansible/Builtin/Apt/default.dhall b/Ansible/Builtin/Apt/default.dhall index 2e613ee..f5b0463 100644 --- a/Ansible/Builtin/Apt/default.dhall +++ b/Ansible/Builtin/Apt/default.dhall @@ -1,8 +1,10 @@ -{ allow_downgrade = None Bool +{ allow_change_held_packages = None Bool +, allow_downgrade = None Bool , allow_unauthenticated = None Bool , autoclean = None Bool , autoremove = None Bool , cache_valid_time = None Natural +, clean = None Bool , deb = None Text , default_release = None Text , dpkg_options = None Text diff --git a/Ansible/Builtin/Blockinfile/Type.dhall b/Ansible/Builtin/Blockinfile/Type.dhall index a11f491..d7aa12d 100644 --- a/Ansible/Builtin/Blockinfile/Type.dhall +++ b/Ansible/Builtin/Blockinfile/Type.dhall @@ -1,4 +1,5 @@ -{ attributes : Optional Text +{ append_newline : Optional Bool +, attributes : Optional Text , backup : Optional Bool , block : Optional Text , create : Optional Bool @@ -11,6 +12,7 @@ , mode : Optional Text , owner : Optional Text , path : Text +, prepend_newline : Optional Bool , selevel : Optional Text , serole : Optional Text , setype : Optional Text diff --git a/Ansible/Builtin/Blockinfile/default.dhall b/Ansible/Builtin/Blockinfile/default.dhall index 2aa23f8..7ef2b9a 100644 --- a/Ansible/Builtin/Blockinfile/default.dhall +++ b/Ansible/Builtin/Blockinfile/default.dhall @@ -1,4 +1,5 @@ -{ attributes = None Text +{ append_newline = None Bool +, attributes = None Text , backup = None Bool , block = None Text , create = None Bool @@ -10,6 +11,7 @@ , marker_end = None Text , mode = None Text , owner = None Text +, prepend_newline = None Bool , selevel = None Text , serole = None Text , setype = None Text diff --git a/Ansible/Builtin/Command/Type.dhall b/Ansible/Builtin/Command/Type.dhall index d89a2a4..6c49367 100644 --- a/Ansible/Builtin/Command/Type.dhall +++ b/Ansible/Builtin/Command/Type.dhall @@ -2,10 +2,10 @@ , chdir : Optional Text , cmd : Optional Text , creates : Optional Text +, expand_argument_vars : Optional Bool , free_form : Optional Text , removes : Optional Text , stdin : Optional Text , stdin_add_newline : Optional Bool , strip_empty_ends : Optional Bool -, warn : Optional Bool } \ No newline at end of file diff --git a/Ansible/Builtin/Command/default.dhall b/Ansible/Builtin/Command/default.dhall index 0bf57a0..67950a4 100644 --- a/Ansible/Builtin/Command/default.dhall +++ b/Ansible/Builtin/Command/default.dhall @@ -2,10 +2,10 @@ , chdir = None Text , cmd = None Text , creates = None Text +, expand_argument_vars = None Bool , free_form = None Text , removes = None Text , stdin = None Text , stdin_add_newline = None Bool , strip_empty_ends = None Bool -, warn = None Bool } \ No newline at end of file diff --git a/Ansible/Builtin/Deb822Repository/Type.dhall b/Ansible/Builtin/Deb822Repository/Type.dhall new file mode 100644 index 0000000..109721e --- /dev/null +++ b/Ansible/Builtin/Deb822Repository/Type.dhall @@ -0,0 +1,23 @@ +{ allow_downgrade_to_insecure : Optional Bool +, allow_insecure : Optional Bool +, allow_weak : Optional Bool +, architectures : Optional (List Text) +, by_hash : Optional Bool +, check_date : Optional Bool +, check_valid_until : Optional Bool +, components : Optional (List Text) +, date_max_future : Optional Natural +, enabled : Optional Bool +, inrelease_path : Optional Text +, languages : Optional (List Text) +, mode : Optional Text +, name : Text +, pdiffs : Optional Bool +, signed_by : Optional Text +, state : Optional ./state.dhall +, suites : Optional (List Text) +, targets : Optional (List Text) +, trusted : Optional Bool +, types : Optional (List Text) +, uris : Optional (List Text) +} \ No newline at end of file diff --git a/Ansible/Builtin/Deb822Repository/default.dhall b/Ansible/Builtin/Deb822Repository/default.dhall new file mode 100644 index 0000000..6a2be76 --- /dev/null +++ b/Ansible/Builtin/Deb822Repository/default.dhall @@ -0,0 +1,22 @@ +{ allow_downgrade_to_insecure = None Bool +, allow_insecure = None Bool +, allow_weak = None Bool +, architectures = None (List Text) +, by_hash = None Bool +, check_date = None Bool +, check_valid_until = None Bool +, components = None (List Text) +, date_max_future = None Natural +, enabled = None Bool +, inrelease_path = None Text +, languages = None (List Text) +, mode = None Text +, pdiffs = None Bool +, signed_by = None Text +, state = None ./state.dhall +, suites = None (List Text) +, targets = None (List Text) +, trusted = None Bool +, types = None (List Text) +, uris = None (List Text) +} \ No newline at end of file diff --git a/Ansible/Builtin/Deb822Repository/package.dhall b/Ansible/Builtin/Deb822Repository/package.dhall new file mode 100644 index 0000000..151d2fb --- /dev/null +++ b/Ansible/Builtin/Deb822Repository/package.dhall @@ -0,0 +1 @@ +-- to be filled by shake diff --git a/Ansible/Builtin/Deb822Repository/state.dhall b/Ansible/Builtin/Deb822Repository/state.dhall new file mode 100644 index 0000000..cc24818 --- /dev/null +++ b/Ansible/Builtin/Deb822Repository/state.dhall @@ -0,0 +1 @@ +< absent | present > \ No newline at end of file diff --git a/Ansible/Builtin/Dnf/Type.dhall b/Ansible/Builtin/Dnf/Type.dhall index a899d0b..7bd6464 100644 --- a/Ansible/Builtin/Dnf/Type.dhall +++ b/Ansible/Builtin/Dnf/Type.dhall @@ -18,13 +18,15 @@ , installroot : Optional Text , list : Optional Text , lock_timeout : Optional Natural -, name : List Text +, name : Optional (List Text) , nobest : Optional Bool , releasever : Optional Text , security : Optional Bool , skip_broken : Optional Bool +, sslverify : Optional Bool , state : Optional ./state.dhall , update_cache : Optional Bool , update_only : Optional Bool +, use_backend : Optional ./use_backend.dhall , validate_certs : Optional Bool } \ No newline at end of file diff --git a/Ansible/Builtin/Dnf/default.dhall b/Ansible/Builtin/Dnf/default.dhall index 09d40a6..898d8f2 100644 --- a/Ansible/Builtin/Dnf/default.dhall +++ b/Ansible/Builtin/Dnf/default.dhall @@ -18,12 +18,15 @@ , installroot = None Text , list = None Text , lock_timeout = None Natural +, name = None (List Text) , nobest = None Bool , releasever = None Text , security = None Bool , skip_broken = None Bool +, sslverify = None Bool , state = None ./state.dhall , update_cache = None Bool , update_only = None Bool +, use_backend = None ./use_backend.dhall , validate_certs = None Bool } \ No newline at end of file diff --git a/Ansible/Builtin/Dnf/use_backend.dhall b/Ansible/Builtin/Dnf/use_backend.dhall new file mode 100644 index 0000000..8baeffb --- /dev/null +++ b/Ansible/Builtin/Dnf/use_backend.dhall @@ -0,0 +1 @@ +< auto | dnf4 | dnf5 > \ No newline at end of file diff --git a/Ansible/Builtin/Dnf5/Type.dhall b/Ansible/Builtin/Dnf5/Type.dhall new file mode 100644 index 0000000..04d7b8a --- /dev/null +++ b/Ansible/Builtin/Dnf5/Type.dhall @@ -0,0 +1,31 @@ +{ allow_downgrade : Optional Bool +, allowerasing : Optional Bool +, autoremove : Optional Bool +, bugfix : Optional Bool +, cacheonly : Optional Bool +, conf_file : Optional Text +, disable_excludes : Optional Text +, disable_gpg_check : Optional Bool +, disable_plugin : Optional (List Text) +, disablerepo : Optional (List Text) +, download_dir : Optional Text +, download_only : Optional Bool +, enable_plugin : Optional (List Text) +, enablerepo : Optional (List Text) +, exclude : Optional (List Text) +, install_repoquery : Optional Bool +, install_weak_deps : Optional Bool +, installroot : Optional Text +, list : Optional Text +, lock_timeout : Optional Natural +, name : Optional (List Text) +, nobest : Optional Bool +, releasever : Optional Text +, security : Optional Bool +, skip_broken : Optional Bool +, sslverify : Optional Bool +, state : Optional ./state.dhall +, update_cache : Optional Bool +, update_only : Optional Bool +, validate_certs : Optional Bool +} \ No newline at end of file diff --git a/Ansible/Builtin/Dnf5/default.dhall b/Ansible/Builtin/Dnf5/default.dhall new file mode 100644 index 0000000..b96eac5 --- /dev/null +++ b/Ansible/Builtin/Dnf5/default.dhall @@ -0,0 +1,31 @@ +{ allow_downgrade = None Bool +, allowerasing = None Bool +, autoremove = None Bool +, bugfix = None Bool +, cacheonly = None Bool +, conf_file = None Text +, disable_excludes = None Text +, disable_gpg_check = None Bool +, disable_plugin = None (List Text) +, disablerepo = None (List Text) +, download_dir = None Text +, download_only = None Bool +, enable_plugin = None (List Text) +, enablerepo = None (List Text) +, exclude = None (List Text) +, install_repoquery = None Bool +, install_weak_deps = None Bool +, installroot = None Text +, list = None Text +, lock_timeout = None Natural +, name = None (List Text) +, nobest = None Bool +, releasever = None Text +, security = None Bool +, skip_broken = None Bool +, sslverify = None Bool +, state = None ./state.dhall +, update_cache = None Bool +, update_only = None Bool +, validate_certs = None Bool +} \ No newline at end of file diff --git a/Ansible/Builtin/Dnf5/package.dhall b/Ansible/Builtin/Dnf5/package.dhall new file mode 100644 index 0000000..151d2fb --- /dev/null +++ b/Ansible/Builtin/Dnf5/package.dhall @@ -0,0 +1 @@ +-- to be filled by shake diff --git a/Ansible/Builtin/Dnf5/state.dhall b/Ansible/Builtin/Dnf5/state.dhall new file mode 100644 index 0000000..bec1a03 --- /dev/null +++ b/Ansible/Builtin/Dnf5/state.dhall @@ -0,0 +1 @@ +< absent | present | installed | removed | latest > \ No newline at end of file diff --git a/Ansible/Builtin/Expect/Type.dhall b/Ansible/Builtin/Expect/Type.dhall index 40961a6..19a0420 100644 --- a/Ansible/Builtin/Expect/Type.dhall +++ b/Ansible/Builtin/Expect/Type.dhall @@ -4,5 +4,5 @@ , echo : Optional Bool , removes : Optional Text , responses : ../JSON.dhall -, timeout : Optional Natural +, timeout : Optional Text } \ No newline at end of file diff --git a/Ansible/Builtin/Expect/default.dhall b/Ansible/Builtin/Expect/default.dhall index ad4ab88..0a06ae6 100644 --- a/Ansible/Builtin/Expect/default.dhall +++ b/Ansible/Builtin/Expect/default.dhall @@ -2,5 +2,5 @@ , creates = None Text , echo = None Bool , removes = None Text -, timeout = None Natural +, timeout = None Text } \ No newline at end of file diff --git a/Ansible/Builtin/Find/Type.dhall b/Ansible/Builtin/Find/Type.dhall index 6923639..94c880a 100644 --- a/Ansible/Builtin/Find/Type.dhall +++ b/Ansible/Builtin/Find/Type.dhall @@ -2,11 +2,13 @@ , age_stamp : Optional ./age_stamp.dhall , contains : Optional Text , depth : Optional Natural +, exact_mode : Optional Bool , excludes : Optional (List Text) , file_type : Optional ./file_type.dhall , follow : Optional Bool , get_checksum : Optional Bool , hidden : Optional Bool +, mode : Optional Text , paths : List Text , patterns : Optional (List Text) , read_whole_file : Optional Bool diff --git a/Ansible/Builtin/Find/default.dhall b/Ansible/Builtin/Find/default.dhall index e3e05fb..89e3976 100644 --- a/Ansible/Builtin/Find/default.dhall +++ b/Ansible/Builtin/Find/default.dhall @@ -2,11 +2,13 @@ , age_stamp = None ./age_stamp.dhall , contains = None Text , depth = None Natural +, exact_mode = None Bool , excludes = None (List Text) , file_type = None ./file_type.dhall , follow = None Bool , get_checksum = None Bool , hidden = None Bool +, mode = None Text , patterns = None (List Text) , read_whole_file = None Bool , recurse = None Bool diff --git a/Ansible/Builtin/GetUrl/Type.dhall b/Ansible/Builtin/GetUrl/Type.dhall index 74649cf..5bf889a 100644 --- a/Ansible/Builtin/GetUrl/Type.dhall +++ b/Ansible/Builtin/GetUrl/Type.dhall @@ -1,8 +1,10 @@ { attributes : Optional Text , backup : Optional Bool , checksum : Optional Text +, ciphers : Optional (List Text) , client_cert : Optional Text , client_key : Optional Text +, decompress : Optional Bool , dest : Text , force : Optional Bool , force_basic_auth : Optional Bool @@ -15,7 +17,6 @@ , serole : Optional Text , setype : Optional Text , seuser : Optional Text -, sha256sum : Optional Text , timeout : Optional Natural , tmp_dest : Optional Text , unredirected_headers : Optional (List Text) @@ -24,6 +25,7 @@ , url_password : Optional Text , url_username : Optional Text , use_gssapi : Optional Bool +, use_netrc : Optional Bool , use_proxy : Optional Bool , validate_certs : Optional Bool } \ No newline at end of file diff --git a/Ansible/Builtin/GetUrl/default.dhall b/Ansible/Builtin/GetUrl/default.dhall index 6d7c1bf..6095194 100644 --- a/Ansible/Builtin/GetUrl/default.dhall +++ b/Ansible/Builtin/GetUrl/default.dhall @@ -1,8 +1,10 @@ { attributes = None Text , backup = None Bool , checksum = None Text +, ciphers = None (List Text) , client_cert = None Text , client_key = None Text +, decompress = None Bool , force = None Bool , force_basic_auth = None Bool , group = None Text @@ -14,7 +16,6 @@ , serole = None Text , setype = None Text , seuser = None Text -, sha256sum = None Text , timeout = None Natural , tmp_dest = None Text , unredirected_headers = None (List Text) @@ -22,6 +23,7 @@ , url_password = None Text , url_username = None Text , use_gssapi = None Bool +, use_netrc = None Bool , use_proxy = None Bool , validate_certs = None Bool } \ No newline at end of file diff --git a/Ansible/Builtin/Group/Type.dhall b/Ansible/Builtin/Group/Type.dhall index a9f340a..e1b4b7f 100644 --- a/Ansible/Builtin/Group/Type.dhall +++ b/Ansible/Builtin/Group/Type.dhall @@ -1,4 +1,5 @@ -{ gid : Optional Natural +{ force : Optional Bool +, gid : Optional Natural , local : Optional Bool , name : Text , non_unique : Optional Bool diff --git a/Ansible/Builtin/Group/default.dhall b/Ansible/Builtin/Group/default.dhall index 6d8561a..eeeb446 100644 --- a/Ansible/Builtin/Group/default.dhall +++ b/Ansible/Builtin/Group/default.dhall @@ -1,4 +1,5 @@ -{ gid = None Natural +{ force = None Bool +, gid = None Natural , local = None Bool , non_unique = None Bool , state = None ./state.dhall diff --git a/Ansible/Builtin/ImportTasks/Type.dhall b/Ansible/Builtin/ImportTasks/Type.dhall deleted file mode 100644 index 4add785..0000000 --- a/Ansible/Builtin/ImportTasks/Type.dhall +++ /dev/null @@ -1 +0,0 @@ -Text \ No newline at end of file diff --git a/Ansible/Builtin/ImportTasks/package.dhall b/Ansible/Builtin/ImportTasks/package.dhall deleted file mode 100644 index ac35283..0000000 --- a/Ansible/Builtin/ImportTasks/package.dhall +++ /dev/null @@ -1 +0,0 @@ -{ Type = ./Type.dhall } diff --git a/Ansible/Builtin/IncludeTasks/Type.dhall b/Ansible/Builtin/IncludeTasks/Type.dhall index 7e993a8..9e26dfe 100644 --- a/Ansible/Builtin/IncludeTasks/Type.dhall +++ b/Ansible/Builtin/IncludeTasks/Type.dhall @@ -1 +1 @@ -{ apply : Optional Text, file : Optional Text } \ No newline at end of file +{} \ No newline at end of file diff --git a/Ansible/Builtin/IncludeTasks/default.dhall b/Ansible/Builtin/IncludeTasks/default.dhall index 1067473..faf1ef8 100644 --- a/Ansible/Builtin/IncludeTasks/default.dhall +++ b/Ansible/Builtin/IncludeTasks/default.dhall @@ -1 +1 @@ -{ apply = None Text, file = None Text } \ No newline at end of file +{=} \ No newline at end of file diff --git a/Ansible/Builtin/IncludeVars/Type.dhall b/Ansible/Builtin/IncludeVars/Type.dhall index addeca6..d35921a 100644 --- a/Ansible/Builtin/IncludeVars/Type.dhall +++ b/Ansible/Builtin/IncludeVars/Type.dhall @@ -1,9 +1,4 @@ -{ depth : Optional Natural -, dir : Optional Text -, extensions : Optional (List Text) -, file : Optional Text -, files_matching : Optional Text -, hash_behaviour : Optional ./hash_behaviour.dhall +{ hash_behaviour : Optional ./hash_behaviour.dhall , ignore_files : Optional (List Text) , ignore_unknown_extensions : Optional Bool , name : Optional Text diff --git a/Ansible/Builtin/IncludeVars/default.dhall b/Ansible/Builtin/IncludeVars/default.dhall index 4c90d87..2f92288 100644 --- a/Ansible/Builtin/IncludeVars/default.dhall +++ b/Ansible/Builtin/IncludeVars/default.dhall @@ -1,9 +1,4 @@ -{ depth = None Natural -, dir = None Text -, extensions = None (List Text) -, file = None Text -, files_matching = None Text -, hash_behaviour = None ./hash_behaviour.dhall +{ hash_behaviour = None ./hash_behaviour.dhall , ignore_files = None (List Text) , ignore_unknown_extensions = None Bool , name = None Text diff --git a/Ansible/Builtin/Iptables/Type.dhall b/Ansible/Builtin/Iptables/Type.dhall index b1dbb17..7b00979 100644 --- a/Ansible/Builtin/Iptables/Type.dhall +++ b/Ansible/Builtin/Iptables/Type.dhall @@ -1,5 +1,6 @@ { action : Optional ./action.dhall , chain : Optional Text +, chain_management : Optional Bool , comment : Optional Text , ctstate : Optional (List Text) , destination : Optional Text @@ -22,6 +23,7 @@ , match : Optional (List Text) , match_set : Optional Text , match_set_flags : Optional ./match_set_flags.dhall +, numeric : Optional Bool , out_interface : Optional Text , policy : Optional ./policy.dhall , protocol : Optional Text diff --git a/Ansible/Builtin/Iptables/default.dhall b/Ansible/Builtin/Iptables/default.dhall index 2ca6dc9..1b24279 100644 --- a/Ansible/Builtin/Iptables/default.dhall +++ b/Ansible/Builtin/Iptables/default.dhall @@ -1,5 +1,6 @@ { action = None ./action.dhall , chain = None Text +, chain_management = None Bool , comment = None Text , ctstate = None (List Text) , destination = None Text @@ -22,6 +23,7 @@ , match = None (List Text) , match_set = None Text , match_set_flags = None ./match_set_flags.dhall +, numeric = None Bool , out_interface = None Text , policy = None ./policy.dhall , protocol = None Text diff --git a/Ansible/Builtin/Shell/Type.dhall b/Ansible/Builtin/Shell/Type.dhall index 2e9f084..88612c7 100644 --- a/Ansible/Builtin/Shell/Type.dhall +++ b/Ansible/Builtin/Shell/Type.dhall @@ -6,5 +6,4 @@ , removes : Optional Text , stdin : Optional Text , stdin_add_newline : Optional Bool -, warn : Optional Bool } \ No newline at end of file diff --git a/Ansible/Builtin/Shell/default.dhall b/Ansible/Builtin/Shell/default.dhall index f06f99b..106ccb9 100644 --- a/Ansible/Builtin/Shell/default.dhall +++ b/Ansible/Builtin/Shell/default.dhall @@ -6,5 +6,4 @@ , removes = None Text , stdin = None Text , stdin_add_newline = None Bool -, warn = None Bool } \ No newline at end of file diff --git a/Ansible/Builtin/SystemdService/Type.dhall b/Ansible/Builtin/SystemdService/Type.dhall new file mode 100644 index 0000000..51e7862 --- /dev/null +++ b/Ansible/Builtin/SystemdService/Type.dhall @@ -0,0 +1,10 @@ +{ daemon_reexec : Optional Bool +, daemon_reload : Optional Bool +, enabled : Optional Bool +, force : Optional Bool +, masked : Optional Bool +, name : Optional Text +, no_block : Optional Bool +, scope : Optional ./scope.dhall +, state : Optional ./state.dhall +} \ No newline at end of file diff --git a/Ansible/Builtin/SystemdService/default.dhall b/Ansible/Builtin/SystemdService/default.dhall new file mode 100644 index 0000000..8c7f4e3 --- /dev/null +++ b/Ansible/Builtin/SystemdService/default.dhall @@ -0,0 +1,10 @@ +{ daemon_reexec = None Bool +, daemon_reload = None Bool +, enabled = None Bool +, force = None Bool +, masked = None Bool +, name = None Text +, no_block = None Bool +, scope = None ./scope.dhall +, state = None ./state.dhall +} \ No newline at end of file diff --git a/Ansible/Builtin/SystemdService/package.dhall b/Ansible/Builtin/SystemdService/package.dhall new file mode 100644 index 0000000..151d2fb --- /dev/null +++ b/Ansible/Builtin/SystemdService/package.dhall @@ -0,0 +1 @@ +-- to be filled by shake diff --git a/Ansible/Builtin/SystemdService/scope.dhall b/Ansible/Builtin/SystemdService/scope.dhall new file mode 100644 index 0000000..2d941fd --- /dev/null +++ b/Ansible/Builtin/SystemdService/scope.dhall @@ -0,0 +1 @@ +< system | user | global > \ No newline at end of file diff --git a/Ansible/Builtin/SystemdService/state.dhall b/Ansible/Builtin/SystemdService/state.dhall new file mode 100644 index 0000000..f4868f2 --- /dev/null +++ b/Ansible/Builtin/SystemdService/state.dhall @@ -0,0 +1 @@ +< reloaded | restarted | started | stopped > \ No newline at end of file diff --git a/Ansible/Builtin/Task/Type.dhall b/Ansible/Builtin/Task/Type.dhall index 4d40b76..49899db 100644 --- a/Ansible/Builtin/Task/Type.dhall +++ b/Ansible/Builtin/Task/Type.dhall @@ -1,4 +1,73 @@ -{ add_host : Optional ../AddHost/Type.dhall +{ `ansible.builtin.apt` : Optional ../Apt/Type.dhall +, `ansible.builtin.apt_key` : Optional ../AptKey/Type.dhall +, `ansible.builtin.apt_repository` : Optional ../AptRepository/Type.dhall +, `ansible.builtin.assemble` : Optional ../Assemble/Type.dhall +, `ansible.builtin.assert` : Optional ../Assert/Type.dhall +, `ansible.builtin.async_status` : Optional ../AsyncStatus/Type.dhall +, `ansible.builtin.blockinfile` : Optional ../Blockinfile/Type.dhall +, `ansible.builtin.command` : Optional ../Command/Type.dhall +, `ansible.builtin.copy` : Optional ../Copy/Type.dhall +, `ansible.builtin.cron` : Optional ../Cron/Type.dhall +, `ansible.builtin.deb822_repository` : Optional ../Deb822Repository/Type.dhall +, `ansible.builtin.debconf` : Optional ../Debconf/Type.dhall +, `ansible.builtin.debug` : Optional ../Debug/Type.dhall +, `ansible.builtin.dnf` : Optional ../Dnf/Type.dhall +, `ansible.builtin.dnf5` : Optional ../Dnf5/Type.dhall +, `ansible.builtin.dpkg_selections` : Optional ../DpkgSelections/Type.dhall +, `ansible.builtin.expect` : Optional ../Expect/Type.dhall +, `ansible.builtin.fail` : Optional ../Fail/Type.dhall +, `ansible.builtin.fetch` : Optional ../Fetch/Type.dhall +, `ansible.builtin.file` : Optional ../File/Type.dhall +, `ansible.builtin.find` : Optional ../Find/Type.dhall +, `ansible.builtin.gather_facts` : Optional ../GatherFacts/Type.dhall +, `ansible.builtin.get_url` : Optional ../GetUrl/Type.dhall +, `ansible.builtin.getent` : Optional ../Getent/Type.dhall +, `ansible.builtin.git` : Optional ../Git/Type.dhall +, `ansible.builtin.group` : Optional ../Group/Type.dhall +, `ansible.builtin.group_by` : Optional ../GroupBy/Type.dhall +, `ansible.builtin.hostname` : Optional ../Hostname/Type.dhall +, `ansible.builtin.import_playbook` : Optional ../ImportPlaybook/Type.dhall +, `ansible.builtin.import_role` : Optional ../ImportRole/Type.dhall +, `ansible.builtin.include_role` : Optional ../IncludeRole/Type.dhall +, `ansible.builtin.include_tasks` : Optional ../IncludeTasks/Type.dhall +, `ansible.builtin.include_vars` : Optional ../IncludeVars/Type.dhall +, `ansible.builtin.iptables` : Optional ../Iptables/Type.dhall +, `ansible.builtin.known_hosts` : Optional ../KnownHosts/Type.dhall +, `ansible.builtin.lineinfile` : Optional ../Lineinfile/Type.dhall +, `ansible.builtin.meta` : Optional ../Meta/Type.dhall +, `ansible.builtin.package` : Optional ../Package/Type.dhall +, `ansible.builtin.package_facts` : Optional ../PackageFacts/Type.dhall +, `ansible.builtin.pause` : Optional ../Pause/Type.dhall +, `ansible.builtin.ping` : Optional ../Ping/Type.dhall +, `ansible.builtin.pip` : Optional ../Pip/Type.dhall +, `ansible.builtin.raw` : Optional ../Raw/Type.dhall +, `ansible.builtin.reboot` : Optional ../Reboot/Type.dhall +, `ansible.builtin.replace` : Optional ../Replace/Type.dhall +, `ansible.builtin.rpm_key` : Optional ../RpmKey/Type.dhall +, `ansible.builtin.script` : Optional ../Script/Type.dhall +, `ansible.builtin.service` : Optional ../Service/Type.dhall +, `ansible.builtin.service_facts` : Optional ../ServiceFacts/Type.dhall +, `ansible.builtin.set_stats` : Optional ../SetStats/Type.dhall +, `ansible.builtin.setup` : Optional ../Setup/Type.dhall +, `ansible.builtin.shell` : Optional ../Shell/Type.dhall +, `ansible.builtin.slurp` : Optional ../Slurp/Type.dhall +, `ansible.builtin.stat` : Optional ../Stat/Type.dhall +, `ansible.builtin.subversion` : Optional ../Subversion/Type.dhall +, `ansible.builtin.systemd` : Optional ../Systemd/Type.dhall +, `ansible.builtin.systemd_service` : Optional ../SystemdService/Type.dhall +, `ansible.builtin.sysvinit` : Optional ../Sysvinit/Type.dhall +, `ansible.builtin.tempfile` : Optional ../Tempfile/Type.dhall +, `ansible.builtin.template` : Optional ../Template/Type.dhall +, `ansible.builtin.unarchive` : Optional ../Unarchive/Type.dhall +, `ansible.builtin.uri` : Optional ../Uri/Type.dhall +, `ansible.builtin.user` : Optional ../User/Type.dhall +, `ansible.builtin.validate_argument_spec` : + Optional ../ValidateArgumentSpec/Type.dhall +, `ansible.builtin.wait_for` : Optional ../WaitFor/Type.dhall +, `ansible.builtin.wait_for_connection` : + Optional ../WaitForConnection/Type.dhall +, `ansible.builtin.yum` : Optional ../Yum/Type.dhall +, `ansible.builtin.yum_repository` : Optional ../YumRepository/Type.dhall , apt : Optional ../Apt/Type.dhall , apt_key : Optional ../AptKey/Type.dhall , apt_repository : Optional ../AptRepository/Type.dhall @@ -9,9 +78,11 @@ , command : Optional ../Command/Type.dhall , copy : Optional ../Copy/Type.dhall , cron : Optional ../Cron/Type.dhall +, deb822_repository : Optional ../Deb822Repository/Type.dhall , debconf : Optional ../Debconf/Type.dhall , debug : Optional ../Debug/Type.dhall , dnf : Optional ../Dnf/Type.dhall +, dnf5 : Optional ../Dnf5/Type.dhall , dpkg_selections : Optional ../DpkgSelections/Type.dhall , expect : Optional ../Expect/Type.dhall , fail : Optional ../Fail/Type.dhall @@ -27,8 +98,6 @@ , hostname : Optional ../Hostname/Type.dhall , import_playbook : Optional ../ImportPlaybook/Type.dhall , import_role : Optional ../ImportRole/Type.dhall -, import_tasks : Optional ../ImportTasks/Type.dhall -, include : Optional ../Include/Type.dhall , include_role : Optional ../IncludeRole/Type.dhall , include_tasks : Optional ../IncludeTasks/Type.dhall , include_vars : Optional ../IncludeVars/Type.dhall @@ -55,6 +124,7 @@ , stat : Optional ../Stat/Type.dhall , subversion : Optional ../Subversion/Type.dhall , systemd : Optional ../Systemd/Type.dhall +, systemd_service : Optional ../SystemdService/Type.dhall , sysvinit : Optional ../Sysvinit/Type.dhall , tempfile : Optional ../Tempfile/Type.dhall , template : Optional ../Template/Type.dhall diff --git a/Ansible/Builtin/Task/default.dhall b/Ansible/Builtin/Task/default.dhall index 0cdd9b8..01448d7 100644 --- a/Ansible/Builtin/Task/default.dhall +++ b/Ansible/Builtin/Task/default.dhall @@ -1,4 +1,72 @@ -{ add_host = None ../AddHost/Type.dhall +{ `ansible.builtin.apt` = None ../Apt/Type.dhall +, `ansible.builtin.apt_key` = None ../AptKey/Type.dhall +, `ansible.builtin.apt_repository` = None ../AptRepository/Type.dhall +, `ansible.builtin.assemble` = None ../Assemble/Type.dhall +, `ansible.builtin.assert` = None ../Assert/Type.dhall +, `ansible.builtin.async_status` = None ../AsyncStatus/Type.dhall +, `ansible.builtin.blockinfile` = None ../Blockinfile/Type.dhall +, `ansible.builtin.command` = None ../Command/Type.dhall +, `ansible.builtin.copy` = None ../Copy/Type.dhall +, `ansible.builtin.cron` = None ../Cron/Type.dhall +, `ansible.builtin.deb822_repository` = None ../Deb822Repository/Type.dhall +, `ansible.builtin.debconf` = None ../Debconf/Type.dhall +, `ansible.builtin.debug` = None ../Debug/Type.dhall +, `ansible.builtin.dnf` = None ../Dnf/Type.dhall +, `ansible.builtin.dnf5` = None ../Dnf5/Type.dhall +, `ansible.builtin.dpkg_selections` = None ../DpkgSelections/Type.dhall +, `ansible.builtin.expect` = None ../Expect/Type.dhall +, `ansible.builtin.fail` = None ../Fail/Type.dhall +, `ansible.builtin.fetch` = None ../Fetch/Type.dhall +, `ansible.builtin.file` = None ../File/Type.dhall +, `ansible.builtin.find` = None ../Find/Type.dhall +, `ansible.builtin.gather_facts` = None ../GatherFacts/Type.dhall +, `ansible.builtin.get_url` = None ../GetUrl/Type.dhall +, `ansible.builtin.getent` = None ../Getent/Type.dhall +, `ansible.builtin.git` = None ../Git/Type.dhall +, `ansible.builtin.group` = None ../Group/Type.dhall +, `ansible.builtin.group_by` = None ../GroupBy/Type.dhall +, `ansible.builtin.hostname` = None ../Hostname/Type.dhall +, `ansible.builtin.import_playbook` = None ../ImportPlaybook/Type.dhall +, `ansible.builtin.import_role` = None ../ImportRole/Type.dhall +, `ansible.builtin.include_role` = None ../IncludeRole/Type.dhall +, `ansible.builtin.include_tasks` = None ../IncludeTasks/Type.dhall +, `ansible.builtin.include_vars` = None ../IncludeVars/Type.dhall +, `ansible.builtin.iptables` = None ../Iptables/Type.dhall +, `ansible.builtin.known_hosts` = None ../KnownHosts/Type.dhall +, `ansible.builtin.lineinfile` = None ../Lineinfile/Type.dhall +, `ansible.builtin.meta` = None ../Meta/Type.dhall +, `ansible.builtin.package` = None ../Package/Type.dhall +, `ansible.builtin.package_facts` = None ../PackageFacts/Type.dhall +, `ansible.builtin.pause` = None ../Pause/Type.dhall +, `ansible.builtin.ping` = None ../Ping/Type.dhall +, `ansible.builtin.pip` = None ../Pip/Type.dhall +, `ansible.builtin.raw` = None ../Raw/Type.dhall +, `ansible.builtin.reboot` = None ../Reboot/Type.dhall +, `ansible.builtin.replace` = None ../Replace/Type.dhall +, `ansible.builtin.rpm_key` = None ../RpmKey/Type.dhall +, `ansible.builtin.script` = None ../Script/Type.dhall +, `ansible.builtin.service` = None ../Service/Type.dhall +, `ansible.builtin.service_facts` = None ../ServiceFacts/Type.dhall +, `ansible.builtin.set_stats` = None ../SetStats/Type.dhall +, `ansible.builtin.setup` = None ../Setup/Type.dhall +, `ansible.builtin.shell` = None ../Shell/Type.dhall +, `ansible.builtin.slurp` = None ../Slurp/Type.dhall +, `ansible.builtin.stat` = None ../Stat/Type.dhall +, `ansible.builtin.subversion` = None ../Subversion/Type.dhall +, `ansible.builtin.systemd` = None ../Systemd/Type.dhall +, `ansible.builtin.systemd_service` = None ../SystemdService/Type.dhall +, `ansible.builtin.sysvinit` = None ../Sysvinit/Type.dhall +, `ansible.builtin.tempfile` = None ../Tempfile/Type.dhall +, `ansible.builtin.template` = None ../Template/Type.dhall +, `ansible.builtin.unarchive` = None ../Unarchive/Type.dhall +, `ansible.builtin.uri` = None ../Uri/Type.dhall +, `ansible.builtin.user` = None ../User/Type.dhall +, `ansible.builtin.validate_argument_spec` = + None ../ValidateArgumentSpec/Type.dhall +, `ansible.builtin.wait_for` = None ../WaitFor/Type.dhall +, `ansible.builtin.wait_for_connection` = None ../WaitForConnection/Type.dhall +, `ansible.builtin.yum` = None ../Yum/Type.dhall +, `ansible.builtin.yum_repository` = None ../YumRepository/Type.dhall , apt = None ../Apt/Type.dhall , apt_key = None ../AptKey/Type.dhall , apt_repository = None ../AptRepository/Type.dhall @@ -9,9 +77,11 @@ , command = None ../Command/Type.dhall , copy = None ../Copy/Type.dhall , cron = None ../Cron/Type.dhall +, deb822_repository = None ../Deb822Repository/Type.dhall , debconf = None ../Debconf/Type.dhall , debug = None ../Debug/Type.dhall , dnf = None ../Dnf/Type.dhall +, dnf5 = None ../Dnf5/Type.dhall , dpkg_selections = None ../DpkgSelections/Type.dhall , expect = None ../Expect/Type.dhall , fail = None ../Fail/Type.dhall @@ -27,8 +97,6 @@ , hostname = None ../Hostname/Type.dhall , import_playbook = None ../ImportPlaybook/Type.dhall , import_role = None ../ImportRole/Type.dhall -, import_tasks = None ../ImportTasks/Type.dhall -, include = None ../Include/Type.dhall , include_role = None ../IncludeRole/Type.dhall , include_tasks = None ../IncludeTasks/Type.dhall , include_vars = None ../IncludeVars/Type.dhall @@ -55,6 +123,7 @@ , stat = None ../Stat/Type.dhall , subversion = None ../Subversion/Type.dhall , systemd = None ../Systemd/Type.dhall +, systemd_service = None ../SystemdService/Type.dhall , sysvinit = None ../Sysvinit/Type.dhall , tempfile = None ../Tempfile/Type.dhall , template = None ../Template/Type.dhall diff --git a/Ansible/Builtin/Uri/Type.dhall b/Ansible/Builtin/Uri/Type.dhall index 01cb3d5..f01e8f4 100644 --- a/Ansible/Builtin/Uri/Type.dhall +++ b/Ansible/Builtin/Uri/Type.dhall @@ -2,9 +2,11 @@ , body : Optional Text , body_format : Optional ./body_format.dhall , ca_path : Optional Text +, ciphers : Optional (List Text) , client_cert : Optional Text , client_key : Optional Text , creates : Optional Text +, decompress : Optional Bool , dest : Optional Text , follow_redirects : Optional ./follow_redirects.dhall , force : Optional Bool @@ -32,6 +34,7 @@ , url_password : Optional Text , url_username : Optional Text , use_gssapi : Optional Bool +, use_netrc : Optional Bool , use_proxy : Optional Bool , validate_certs : Optional Bool } \ No newline at end of file diff --git a/Ansible/Builtin/Uri/default.dhall b/Ansible/Builtin/Uri/default.dhall index 8cdd60e..d90b4c6 100644 --- a/Ansible/Builtin/Uri/default.dhall +++ b/Ansible/Builtin/Uri/default.dhall @@ -2,9 +2,11 @@ , body = None Text , body_format = None ./body_format.dhall , ca_path = None Text +, ciphers = None (List Text) , client_cert = None Text , client_key = None Text , creates = None Text +, decompress = None Bool , dest = None Text , follow_redirects = None ./follow_redirects.dhall , force = None Bool @@ -31,6 +33,7 @@ , url_password = None Text , url_username = None Text , use_gssapi = None Bool +, use_netrc = None Bool , use_proxy = None Bool , validate_certs = None Bool } \ No newline at end of file diff --git a/Ansible/Builtin/User/Type.dhall b/Ansible/Builtin/User/Type.dhall index f6b51d6..fcebdd9 100644 --- a/Ansible/Builtin/User/Type.dhall +++ b/Ansible/Builtin/User/Type.dhall @@ -17,6 +17,7 @@ , password : Optional Text , password_expire_max : Optional Natural , password_expire_min : Optional Natural +, password_expire_warn : Optional Natural , password_lock : Optional Bool , profile : Optional Text , remove : Optional Bool diff --git a/Ansible/Builtin/User/default.dhall b/Ansible/Builtin/User/default.dhall index 563b66b..f9d3ed6 100644 --- a/Ansible/Builtin/User/default.dhall +++ b/Ansible/Builtin/User/default.dhall @@ -16,6 +16,7 @@ , password = None Text , password_expire_max = None Natural , password_expire_min = None Natural +, password_expire_warn = None Natural , password_lock = None Bool , profile = None Text , remove = None Bool diff --git a/Ansible/Builtin/Yum/Type.dhall b/Ansible/Builtin/Yum/Type.dhall index b43ca15..ee1fc78 100644 --- a/Ansible/Builtin/Yum/Type.dhall +++ b/Ansible/Builtin/Yum/Type.dhall @@ -21,6 +21,7 @@ , releasever : Optional Text , security : Optional Bool , skip_broken : Optional Bool +, sslverify : Optional Bool , state : Optional ./state.dhall , update_cache : Optional Bool , update_only : Optional Bool diff --git a/Ansible/Builtin/Yum/default.dhall b/Ansible/Builtin/Yum/default.dhall index b840c31..0f380bb 100644 --- a/Ansible/Builtin/Yum/default.dhall +++ b/Ansible/Builtin/Yum/default.dhall @@ -21,6 +21,7 @@ , releasever = None Text , security = None Bool , skip_broken = None Bool +, sslverify = None Bool , state = None ./state.dhall , update_cache = None Bool , update_only = None Bool diff --git a/Ansible/Builtin/Yum/use_backend.dhall b/Ansible/Builtin/Yum/use_backend.dhall index d480c82..3856d20 100644 --- a/Ansible/Builtin/Yum/use_backend.dhall +++ b/Ansible/Builtin/Yum/use_backend.dhall @@ -1 +1 @@ -< auto | yum | yum4 | dnf > \ No newline at end of file +< auto | yum | yum4 | dnf | dnf4 | dnf5 > \ No newline at end of file diff --git a/Ansible/Builtin/YumRepository/ip_resolve.dhall b/Ansible/Builtin/YumRepository/ip_resolve.dhall index f8db48f..218281a 100644 --- a/Ansible/Builtin/YumRepository/ip_resolve.dhall +++ b/Ansible/Builtin/YumRepository/ip_resolve.dhall @@ -1 +1 @@ -< `` > \ No newline at end of file +< `4` | `6` | IPv4 | IPv6 | whatever > \ No newline at end of file diff --git a/Ansible/Builtin/package.dhall b/Ansible/Builtin/package.dhall index f59b340..5bf5023 100644 --- a/Ansible/Builtin/package.dhall +++ b/Ansible/Builtin/package.dhall @@ -28,7 +28,6 @@ , Hostname = ./Hostname/package.dhall , ImportPlaybook = ./ImportPlaybook/package.dhall , ImportRole = ./ImportRole/package.dhall -, ImportTasks = ./ImportTasks/package.dhall , Include = ./Include/package.dhall , IncludeRole = ./IncludeRole/package.dhall , IncludeTasks = ./IncludeTasks/package.dhall diff --git a/Ansible/package.dhall b/Ansible/package.dhall index 2f810a2..cdafbab 100644 --- a/Ansible/package.dhall +++ b/Ansible/package.dhall @@ -28,7 +28,6 @@ let Builtin = , Hostname = ./Builtin/Hostname/package.dhall , ImportPlaybook = ./Builtin/ImportPlaybook/package.dhall , ImportRole = ./Builtin/ImportRole/package.dhall - , ImportTasks = ./Builtin/ImportTasks/package.dhall , Include = ./Builtin/Include/package.dhall , IncludeRole = ./Builtin/IncludeRole/package.dhall , IncludeTasks = ./Builtin/IncludeTasks/package.dhall diff --git a/README.md b/README.md index 7d7f2fb..85747d0 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,10 @@ in Export // { Task, Play } Frozen packages are available in the tag commit. +### 0.4.0 + +- Update to ansible-2.16 + ### 0.3.0 - Add missing add_host attributes. diff --git a/Shakefile.hs b/Shakefile.hs index 27bb197..34adbe0 100755 --- a/Shakefile.hs +++ b/Shakefile.hs @@ -16,7 +16,7 @@ test = phony "test" $ do where testLoad :: String -> Action String testLoad testCase = do - Stdout s <- cmd "yaml-to-dhall" ["List (./package.dhall).Play.Type"] "--file" ("tests/" <> testCase) + Stdout s <- cmd "yaml-to-dhall" ["List (./package.dhall).Play.Type"] "--records-loose" "--file" ("tests/" <> testCase) pure s main :: IO () diff --git a/ansible-collection-to-dhall/Main.hs b/ansible-collection-to-dhall/Main.hs index 6d57c28..7d36072 100755 --- a/ansible-collection-to-dhall/Main.hs +++ b/ansible-collection-to-dhall/Main.hs @@ -9,13 +9,14 @@ import Data.Aeson import Data.Aeson.Types (Parser) -import qualified Data.HashMap.Strict as HM import qualified Data.List as L import qualified Data.Map as Map import qualified Data.Text as Text import qualified Data.Vector as V import qualified Dhall.Core as D import qualified Dhall.Map as D +import qualified Data.Aeson.KeyMap as KM +import qualified Data.Aeson.Key as K import Options.Generic import Relude import System.Directory (createDirectoryIfMissing, doesFileExist) @@ -41,7 +42,9 @@ skipModules = "community.okd.openshift_process", "community.okd.openshift_route", -- Provided by base task - "set_fact" + "ansible.builtin.set_fact", + "ansible.builtin.add_host", + "ansible.builtin.import_tasks" ] skipModule :: ModuleName -> Bool @@ -108,8 +111,8 @@ data ModuleOption = ModuleOption deriving (Eq, Ord, Show) -- | Parse a module option from the documentation json -parseOption :: (Text, Value) -> Parser ModuleOption -parseOption (name, Object v) = ModuleOption name <$> parseRequired <*> parseDescription <*> parseType +parseOption :: (KM.Key, Value) -> Parser ModuleOption +parseOption (name, Object v) = ModuleOption (K.toText name) <$> parseRequired <*> parseDescription <*> parseType where textArray :: [Value] -> [Text] textArray [] = [] @@ -144,12 +147,12 @@ parseOption (name, Object v) = ModuleOption name <$> parseRequired <*> parseDesc Just (String "int") -> pure OInt Just (String "json") -> pure OJson Just (String "float") -> pure ODouble - _ -> fail ("Unknown " <> toString name <> " type: " <> show t <> " in " <> show v) + _ -> fail ("Unknown " <> K.toString name <> " type: " <> show t <> " in " <> show v) parseChoice = do choices <- v .:? "choices" case choices of Just (Array t) -> pure $ OChoice $ textArray (V.toList t) - Just x -> fail ("Unknown " <> toString name <> " array: " <> show x) + Just x -> fail ("Unknown " <> K.toString name <> " array: " <> show x) Nothing -> pure OText parseOption _ = error "Invalid option type" @@ -157,13 +160,13 @@ newtype ModuleOptions = ModuleOptions [ModuleOption] deriving (Eq, Ord, Show) -- | FromJSON instance to decode a module options from the documentation json instance FromJSON ModuleOptions where - parseJSON (Object v) = case HM.elems v of + parseJSON (Object v) = case KM.elems v of [v'] -> case v' of Object obj -> do doc <- obj .: "doc" options <- doc .:? "options" case options of - Just (Object options') -> ModuleOptions <$> mapM parseOption (HM.toList options') + Just (Object options') -> ModuleOptions <$> mapM parseOption (KM.toList options') Nothing -> pure (ModuleOptions []) _ -> empty _ -> empty @@ -246,8 +249,11 @@ dhallCollectionPackage xs = ("default.dhall", D.RecordLit . mkMap $ L.foldl goDefault [] xs) ] where - goType acc (ModuleName name, fp, _) = (name, attr D.Optional fp) : acc - goDefault acc (ModuleName name, fp, _) = (name, attr D.None fp) : acc + addBuiltin (name, val) acc + | Text.isPrefixOf "ansible.builtin." name = (Text.drop 16 name, val) : (name, val) : acc + | otherwise = (name, val) : acc + goType acc (ModuleName name, fp, _) = addBuiltin (name, attr D.Optional fp) acc + goDefault acc (ModuleName name, fp, _) = addBuiltin (name, attr D.None fp) acc attr func fp = D.makeRecordField $ D.App func (mkImport D.Parent [toText fp] "Type.dhall") ---------------------------------------------------------------------------------------------------- @@ -278,7 +284,7 @@ mergeModules = Map.toList . go mempty type Collection = (Text, [(ModuleName, FilePath, ModuleOptions)]) doCollection :: FilePath -> Collection -> IO () -doCollection root (name, modules) = do +doCollection root (cname, modules) = do touchPackage collectionDir unless (name == "Builtin") writeTemplates writeCollection @@ -286,6 +292,7 @@ doCollection root (name, modules) = do when needJson writeJsonType putText "Done." where + name = Text.replace "AnsibleBuiltin" "Builtin" cname writeJsonType = writeFileText (collectionDir "JSON.dhall") jsonImportText jsonImportText = ( "https://prelude.dhall-lang.org/v17.0.0/JSON/Type " @@ -399,9 +406,7 @@ filterModules prefix onlyBuiltin onlyHardware = L.foldl go [] isHardware :: Text -> Text -> Bool isHardware = flip Text.isPrefixOf isBuiltin :: Text -> Bool - isBuiltin name = case Text.find ('.' ==) name of - Just _ -> False - Nothing -> True + isBuiltin name = Text.isPrefixOf "ansible.builtin" name go :: [ModuleName] -> ModuleName -> [ModuleName] go acc (ModuleName name) = let keep = case (prefix, onlyBuiltin, onlyHardware) of diff --git a/ansible-collection-to-dhall/README.md b/ansible-collection-to-dhall/README.md index f4a3446..1096536 100644 --- a/ansible-collection-to-dhall/README.md +++ b/ansible-collection-to-dhall/README.md @@ -23,31 +23,3 @@ Update builtins: $ cabal run ansible-collection-to-dhall -- --ansible_doc ./venv/bin/ansible-doc --builtin --output ../Ansible/ $ cd ..; shake ``` - -## With nix - -Create a nix-shell with both ansible-colleciton-to-dhall and the shake rules using this expression (and update the commit if needed): - -```nix -let - pkgs = import {}; - dhall-ansible = pkgs.fetchFromGitHub { - owner = "softwarefactory-project"; - repo = "dhall-ansible"; - rev = "ed0acc275b3fe70efaf4e96b645721df91b236b1"; - sha256 = "sha256-cJvQsT5SDxUzvHuNmfHrZ+ufyOzZw6qIqLbQb7Jmexc="; - }; - shake-factory = pkgs.fetchFromGitHub { - owner = "softwarefactory-project"; - repo = "shake-factory"; - rev = "44895e0a005b6cec4722d57e3dc5c37a51b8ee0f"; - sha256 = "sha256-LaUCy6qFiB/iulWFe3vf6R4l1FsFtlLVJd5aoElNyQU="; - }; - ansible-collection-to-dhall = - pkgs.callPackage (dhall-ansible + "/ansible-collection-to-dhall") {}; - shake = import shake-factory; -in - pkgs.mkShell { - buildInputs = [ ansible-collection-to-dhall ] ++ shake; - } -``` diff --git a/ansible-collection-to-dhall/ansible-collection-to-dhall.cabal b/ansible-collection-to-dhall/ansible-collection-to-dhall.cabal index bd8e58e..819d542 100644 --- a/ansible-collection-to-dhall/ansible-collection-to-dhall.cabal +++ b/ansible-collection-to-dhall/ansible-collection-to-dhall.cabal @@ -18,8 +18,8 @@ executable ansible-collection-to-dhall -Wmissing-export-lists -Wpartial-fields -Wunused-packages - build-depends: base >=4.14 && <4.15 - , aeson + build-depends: base <5 + , aeson >=2 , containers , unordered-containers , dhall diff --git a/ansible-collection-to-dhall/default.nix b/ansible-collection-to-dhall/default.nix deleted file mode 100644 index cbf22d0..0000000 --- a/ansible-collection-to-dhall/default.nix +++ /dev/null @@ -1,2 +0,0 @@ -{ pkgs ? import ./nixpkgs.nix }: -pkgs.haskellPackages.callCabal2nix "ansible-collection-to-dhall" ./. { } diff --git a/ansible-collection-to-dhall/nixpkgs.nix b/ansible-collection-to-dhall/nixpkgs.nix deleted file mode 100644 index ffb2ebd..0000000 --- a/ansible-collection-to-dhall/nixpkgs.nix +++ /dev/null @@ -1,4 +0,0 @@ -# A pinned nixpkgs -import (fetchTarball - "https://github.com/NixOS/nixpkgs/archive/a6f258f49fcd1644f08b7b3677da2c5e55713291.tar.gz") -{ } diff --git a/ansible-collection-to-dhall/shell.nix b/ansible-collection-to-dhall/shell.nix deleted file mode 100644 index d840db7..0000000 --- a/ansible-collection-to-dhall/shell.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ withHoogle ? false }: -let - nixpkgs = import ./nixpkgs.nix; - drv = import ./default.nix { }; -in nixpkgs.haskellPackages.shellFor { - withHoogle = withHoogle; - packages = p: [ drv ]; - buildInputs = with nixpkgs.haskellPackages; [ hlint cabal-install ]; -} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5bf880a --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1717196966, + "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9413132 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "dhall-ansible"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { localSystem = system; }; + + # The haskell package set override + haskellExtend = hpFinal: hpPrev: { + ansible-collection-to-dhall = + hpPrev.callCabal2nix "ansible-collection-to-dhall" + ./ansible-collection-to-dhall { }; + shake-dhall = pkgs.haskell.lib.dontCheck + (pkgs.haskell.lib.overrideCabal hpPrev.shake-dhall { + broken = false; + }); + shake-factory = let + src = pkgs.fetchFromGitHub { + owner = "softwarefactory-project"; + repo = "shake-factory"; + rev = "44895e0a005b6cec4722d57e3dc5c37a51b8ee0f"; + sha256 = "sha256-LaUCy6qFiB/iulWFe3vf6R4l1FsFtlLVJd5aoElNyQU="; + }; + in pkgs.haskell.lib.doJailbreak + (hpPrev.callCabal2nix "shake-factory" src { }); + }; + hsPkgs = pkgs.haskellPackages.extend haskellExtend; + ghc = hsPkgs.ghcWithPackages + (p: [ p.ansible-collection-to-dhall p.shake-factory p.shake ]); + ciTools = [ + pkgs.cabal-install + pkgs.haskellPackages.fourmolu + pkgs.hlint + ghc + pkgs.dhall-yaml + ]; + devTools = [ pkgs.ghcid pkgs.shake pkgs.ansible ]; + in { + devShell.x86_64-linux = + pkgs.mkShell { buildInputs = ciTools ++ devTools; }; + }; +}